[PATCH] D104810: [Inline] prevent inlining on noprofile mismatch

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 24 12:38:56 PDT 2021


MaskRay added a comment.

LG.

The contract is that the annotated code region, even if inlined or cloned, does not get instrumentation.
I think suppressing inlining a NoProfileAttr callee into a caller without the attr is the only practical approach here,
because a fine-grained per-instruction attribute is obviously cumbersome and likely over-engineering.

Users (mainly the Linux kernel developers) should be aware that `noprofile` does not imply `noinline`.
It just behaves like `noinline` in many use cases.

Add @wmi for test coverage suggestions from the experience of D79959 <https://reviews.llvm.org/D79959> "use-sample-profile".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104810



More information about the llvm-commits mailing list