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

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 18:40:34 PDT 2022


mysterymath added a comment.

In D131628#3897684 <https://reviews.llvm.org/D131628#3897684>, @gulfem wrote:

> How should we proceed on this? AFAICT, we did not get a clear answer about the semantics of `leaf` attribute for `LTO` from LTO semantics for __attribute__((leaf)) <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106725>.
> Would that be ok to drop `nocalback` attribute during linking? There is an LLVM bug now (Missing LangRef documentation for nocallback <https://github.com/llvm/llvm-project/issues/58683>), and `leaf` attribute support will be reverted if we cannot come up with the description.

I spent a little more time on this today, and I was able to come up with a concrete case where GCC will optimize as if the semantics of attribute leaf were LTO-unit, as was implemented in LLVM. I've posted this on the original bug.
Unfortunately, my reproducer has different behavior between the equivalent of GCC's full LTO and thin LTO modes, so I've no idea what they'll do in response to this.

At the very least, the semantics currently implemented in LLVM seem no worse than those than those currently implemented in GCC, but both appear to disagree with their docs and the expectations of those on the GCC bug thread. Personally, I'd think that we could add documentation for the current behavior and call out the controversy, but that call seems a bit above my paygrade. It does seem unlikely that the controversy will be resolved in the immediate future.


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