[PATCH] D130806: [InstrProf] Allow noprofile functions to be inlined

Marco Elver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 12:47:45 PDT 2022


melver added a comment.

In D130806#3697318 <https://reviews.llvm.org/D130806#3697318>, @ellis wrote:

> In D130806#3695858 <https://reviews.llvm.org/D130806#3695858>, @melver wrote:
>
>> ...
>> If a callee with the noprofile attribute is inlined into a profiled function, will it then also be profiled?
>> Is it possible that a noprofile function could receive instrumentation through inlining now?
>>
>> If so, this is wrong and will cause problems. Perhaps for profiling instrumentation it works differently, but for the sanitizers this was an issue we fought for a while to get right everywhere: https://lore.kernel.org/lkml/CANpmjNNRz5OVKb6PE7K6GjfoGbht_ZhyPkNG9aD+KjNDzK7hGg@mail.gmail.com/
>
> The callee won’t technically be profiled, but because it was inlined it could be mixed with instrumentation code. My reasoning was, if a function interacts badly when inlined into an instrumented function, then it probably shouldn’t be inlined at all.

As long as the code in the callee doesn't receive any instrumentation, I think we're fine; i.e. the instructions in the callee are not intermingled with instrumentation, and from the machine's point of view what's missing is the call overhead.


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