[PATCH] D104475: [Clang][Codegen] emit noprofile IR Fn Attr for new Fn Attr no_profile

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 17 14:35:21 PDT 2021


MaskRay added a comment.

In D104475#2825666 <https://reviews.llvm.org/D104475#2825666>, @melver wrote:

> In D104475#2825297 <https://reviews.llvm.org/D104475#2825297>, @MaskRay wrote:
>
>> Should `no_profile` specify the inlining behavior? Though `no_sanitize_*` don't specify that, either.
>
> I think it's somehow implicit, but I can't quite say how. There are some tests that check this, e.g.
> compiler-rt/test/asan/TestCases/inline.cpp
> [...]
> noinstr does add noinline, but other uses of the attribute alone might not. But in the end inlining is a red herring, it just seems to be the easiest way to enforce the promised contract.  See https://lore.kernel.org/lkml/CANpmjNNRz5OVKb6PE7K6GjfoGbht_ZhyPkNG9aD+KjNDzK7hGg@mail.gmail.com/
> [...]

Thanks for the comments.  Recently there is a discussion about LLVM IR function attribute `nointeropt` (similar to a debugging-only GCC function attribute `noipa`).
People tend to think attributes should be orthogonal. I think not suppressing for the IR attribute `no_profile` is nice.
The GNU function attribute (C/C++) may be less clear. We can document that users may need to additionally specify `noinline` to suppress inlining.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104475



More information about the cfe-commits mailing list