[PATCH] D139163: Utils: Add utility pass to lower ifuncs

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 15:36:04 PST 2022


arsenm added a comment.

In D139163#4014227 <https://reviews.llvm.org/D139163#4014227>, @MaskRay wrote:

> There is some inefficiency that the resolver is repeatedly called.
>
>   int __attribute__((target_clones("sse4.2, default"))) foo(void) { return 0; }
>   // clang --target=x86_64-pc-fuchsia -O2 -S a.c   // newer than https://reviews.llvm.org/D127933
>
> If we cache the resolver, do you still need ifunc?

The resolver will fold to a compile time return of a global address. I have another patch to optimize to a direct call. the ifunc / target_clones is for library source and distribution organization issues. I do not care about the performance of the resolver. We don't have compatible ISAs (other than for restricted subsets), so care is needed in the odd case where we would execute a resolver (it mostly works out within a generation. I also think a sufficiently magical piece of asm could work on all subtargets)


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

https://reviews.llvm.org/D139163



More information about the llvm-commits mailing list