[PATCH] D130806: [InstrProf] Allow noprofile functions to be inlined
Ellis Hoag via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 2 12:33:41 PDT 2022
ellis added inline comments.
================
Comment at: llvm/lib/IR/Attributes.cpp:2042-2044
+ if (Caller.hasFnAttribute(Attribute::NoProfile) &&
+ !Callee.hasFnAttribute(Attribute::NoProfile))
+ return false;
----------------
nickdesaulniers wrote:
> Could we create a new CompatRule fn for this? I imagine we might want to reuse such logic for other attributes in the future.
IMO the `CompatRule` unnecessarily obfuscates the code. It took me a while to find this issue because I didn't see `CompatRule` on this attribute. Also, it requires reading several `Attributes.*` files to fully understand what's going on.
Instead, I could pull this out into a regular function and we can later add more calls with the other attributes. Let me know what you think!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130806/new/
https://reviews.llvm.org/D130806
More information about the llvm-commits
mailing list