| 2996 | } |
| 2997 | |
| 2998 | llvm::Value* IrEmitter::ProfilingState::ReadCycleCounter(llvm::IRBuilder<>* b) { |
| 2999 | llvm::Module* module = b->GetInsertBlock()->getModule(); |
| 3000 | if (!use_rdtscp_) { |
| 3001 | llvm::Function* func_llvm_readcyclecounter = |
| 3002 | llvm::Intrinsic::getDeclaration(module, |
| 3003 | llvm::Intrinsic::readcyclecounter); |
| 3004 | return b->CreateCall(func_llvm_readcyclecounter); |
| 3005 | } |
| 3006 | llvm::Function* func_llvm_x86_rdtscp = |
| 3007 | llvm::Intrinsic::getDeclaration(module, llvm::Intrinsic::x86_rdtscp); |
| 3008 | llvm::Value* rdtscp_call = b->CreateCall(func_llvm_x86_rdtscp); |
| 3009 | return b->CreateExtractValue(rdtscp_call, {0}); |
| 3010 | } |
| 3011 | |
| 3012 | void IrEmitter::ProfilingState::RecordCycleStart(llvm::IRBuilder<>* b, |
| 3013 | HloInstruction* hlo) { |
nothing calls this directly
no test coverage detected