diff options
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp index f994f8a..09c56eb 100644 --- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -945,6 +945,9 @@ Value *InstrLowerer::getCounterAddress(InstrProfCntrInstBase *I) { IRBuilder<> EntryBuilder(&Fn->getEntryBlock().front()); auto *Bias = getOrCreateBiasVar(getInstrProfCounterBiasVarName()); BiasLI = EntryBuilder.CreateLoad(Int64Ty, Bias, "profc_bias"); + // Bias doesn't change after startup. + BiasLI->setMetadata(LLVMContext::MD_invariant_load, + MDNode::get(M.getContext(), std::nullopt)); } auto *Add = Builder.CreateAdd(Builder.CreatePtrToInt(Addr, Int64Ty), BiasLI); return Builder.CreateIntToPtr(Add, Addr->getType()); |