MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ReadCycleCounter

Method ReadCycleCounter

tensorflow/compiler/xla/service/cpu/ir_emitter.cc:2998–3010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2996}
2997
2998llvm::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
3012void IrEmitter::ProfilingState::RecordCycleStart(llvm::IRBuilder<>* b,
3013 HloInstruction* hlo) {

Callers

nothing calls this directly

Calls 1

CreateCallMethod · 0.45

Tested by

no test coverage detected