[PATCH] D137360: [Linker] Remove nocallback attribute while linking

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 09:41:03 PST 2022


mysterymath added a comment.

In D137360#3909886 <https://reviews.llvm.org/D137360#3909886>, @nikic wrote:

> I don't think this implementation is correct, but I'm also not entirely sure in which cases you want to drop the attribute and in which you want to retain it. I'd suggest to have the following test cases:
>
> - A nocallback intrinsic, where the attribute should never be dropped.

Is it safe to keep nocallback on intrinsics? It's legal to LTO-in the implementations of various compiler intrinsics, so it seems possible that a call to an intrinsic declared nocallback might be implemented via a call to a a function in the current LTO unit.

With the per-translation-unit semantics for nocallback, you'd only need to guarantee that you don't use the intrinsic in the translation unit that defines its implementation. With the LTO-unit semantics, you couldn't use the intrinsic anywhere in the whole program, which is impossibly restrictive, so instead, you'd be forced to keep the definition out of LTO. This is why I've somewhat changed my tune about the ideal semantics for nocallback.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137360



More information about the llvm-commits mailing list