[llvm] [AIX][TLS] Produce a faster local-exec access sequence for the "aix-small-tls" global variable attribute (PR #83053)

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 13:00:13 PDT 2024


amy-kwan wrote:

> Does it make sense to turn the function level attribute HasAIXSmallLocalExecTLS into variable attributes for example by `addAttribute` inside `LowerGlobalTLSAddressAIX`, and then we only need to check variable attribute for the peepholes?
> 
> For any TLS LE variable accessed by more than one functions, and if one of them HasAIXSmallLocalExecTLS, then that variable should better have the "aix-small-tls" attribute?

Thanks for taking a look at the patch, @orcguru! I apologize if I misunderstood your suggestion: are you suggesting that `HasAIXSmallLocalExecTLS` should be a variable attribute, similar to `aix-small-tls`?

The target/function attribute was implemented to correspond to the front end clang option to turn on this optimized code gen (`-maix-small-local-exec-tls`) for all variables. However, I believe this `aix-small-tls` is more about selectively deciding which TLS LE variables get the optimized code gen. On the other hand, in the presence of `HasAIXSmallLocalExecTLS` (when this is turned on/true), I remember discussing that the optimized code sequence gets generated for all cases, anyway.

@hubert-reinterpretcast Is my above understanding correct, and do you have any thoughts on this/the suggestion?

https://github.com/llvm/llvm-project/pull/83053


More information about the llvm-commits mailing list