[llvm] InstrProfiling: Split creating Bias offset to getOrCreateBiasVar(Name). NFC. (PR #95692)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 10:50:38 PDT 2024


================
@@ -885,6 +889,29 @@ void InstrLowerer::lowerValueProfileInst(InstrProfValueProfileInst *Ind) {
   Ind->eraseFromParent();
 }
 
+GlobalVariable *InstrLowerer::getOrCreateBiasVar(StringRef VarName) {
+  auto *Bias = M.getGlobalVariable(VarName);
+  if (Bias)
+    return Bias;
----------------
ellishg wrote:

```suggestion
  if (auto *Bias = M.getGlobalVariable(VarName))
    return Bias;
```

https://github.com/llvm/llvm-project/pull/95692


More information about the llvm-commits mailing list