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

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 12:25:09 PDT 2022


ellis added a comment.

In D130806#3695858 <https://reviews.llvm.org/D130806#3695858>, @melver wrote:

> In D130806#3695022 <https://reviews.llvm.org/D130806#3695022>, @ellis wrote:
>
>> In D130806#3694879 <https://reviews.llvm.org/D130806#3694879>, @nickdesaulniers wrote:
>>
>>> I observed no new build or runtime warnings when compiling the linux kernel with gcov enabled (CONFIG_GCOV_KERNEL=y + CONFIG_GCOV_PROFILE_ALL=y) or kcsan (CONFIG_KCSAN=y) (x86).
>>
>> Thanks for checking!
>
> 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.


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