[clang] [SampleProf][OMP] Handle OMP helper function name canonicalization (PR #178339)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 30 06:24:06 PST 2026


================
@@ -1099,7 +1099,8 @@ emitCombinerOrInitializer(CodeGenModule &CGM, QualType Ty,
   auto *Fn = llvm::Function::Create(FnTy, llvm::GlobalValue::InternalLinkage,
                                     Name, &CGM.getModule());
   CGM.SetInternalFunctionAttributes(GlobalDecl(), Fn, FnInfo);
-  Fn->addFnAttr("sample-profile-suffix-elision-policy", "selected");
+  if (!CGM.getCodeGenOpts().SampleProfileFile.empty())
----------------
shiltian wrote:

Is there a better option or flag to check whether PGO is enabled? I thought the enabling flag would be a combination of something like `--enable-pgo --sample-profile-name`.

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


More information about the cfe-commits mailing list