[PATCH] D129413: [InstrProf] Allow compiler generated functions in SCL

Ellis Hoag via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 11 19:30:30 PDT 2022


ellis planned changes to this revision.
ellis added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3894-3896
+  if (getCodeGenOpts().getProfileInstr() != CodeGenOptions::ProfileNone)
+    if (isProfileInstrExcluded(F, SourceLocation()))
+      F->addFnAttr(llvm::Attribute::NoProfile);
----------------
ellis wrote:
> phosek wrote:
> > Do we still need https://github.com/llvm/llvm-project/blob/759e5e0096f650515799805828f9ac5b7d4a7303/clang/lib/CodeGen/CodeGenFunction.cpp#L856 if we set the attribute here?
> Both are needed. Here the attribute is added in `GetOrCreateLLVMFunction()` which I believe only creates compiler generated functions. Where you linked is called when normal functions are generated.
Oh sorry, I was mistaken. I'd like to figure out how to only have this code in one location.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129413/new/

https://reviews.llvm.org/D129413



More information about the cfe-commits mailing list