[PATCH] D131628: [LangRef] Add description for nocallback attribute

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 04:34:05 PDT 2022


nlopes added a comment.

In D131628#3740602 <https://reviews.llvm.org/D131628#3740602>, @mysterymath wrote:

> In D131628#3738046 <https://reviews.llvm.org/D131628#3738046>, @nlopes wrote:
>
>> GIven that the semantics of gcc's leaf attribute is per file, [...]
>
> I finally got around to compiling up a GCC instance and adding enough printfs to the tree dumper to see what it does on the main/foo/bar example I gave above.
> As far as I can tell, GCC doesn't drop `__attribute__((leaf))` when merging modules in LTO, as the call to `foo` in `main` is internally marked as leaf, even when LTOed against `bar`, keeping the `foo` module out of the LTO unit.
>
> If this behavior is intentional (and I didn't mess up the measurement), then "compilation unit" in the GCC doc must refer to LTO unit in the case of LTO. If it's unintentional, then there may be a bug to file against both GCC and LLVM.
>
> I'm fairly novice with GCC, so it's reasonably likely that I screwed something up. I'd welcome someone with more experience trying to reproduce or falsify these results.
>
> If these results are correct, then my suggestion would be to explicitly codify this behavior, since it provides the most utility for the feature in case of LTO, and it's consistent with GCC's actual behavior and one reading of it's somewhat ambiguous feature description.

Thank you!
Do you mind filing a bug report with gcc, please? Either the code or the documentation needs fixing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131628



More information about the llvm-commits mailing list