================
@@ -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())
----------------
apolloww wrote:

We enable sampling PGO with just one flag `-fprofile-sample-use` and this is 
also how clang adds other PGO related function attribute 
https://github.com/llvm/llvm-project/blob/7994daccd9241837740170457f2736778c294a23/clang/lib/CodeGen/CodeGenFunction.cpp#L996

https://github.com/llvm/llvm-project/pull/178339
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to