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

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 12:38:12 PDT 2022


mysterymath added a comment.

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 merges the modules naively in LTO with resepect to `__attribute__((leaf))`, 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.


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