[llvm] [X86] Asm modifier %a: add (%rip) for 64-bit static relocation model (PR #139040)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 18:49:11 PDT 2025


KanRobert wrote:

> In GCC,
> 
> ```
> static int a;
> asm("# %0" : : "i"(&a));
> ```
> 
> lowers to `# a(%rip)` regardless of the PIC mode. This PR follow suits for ELF -fno-pic, matching ELF -fpic (asm-modifier-pic.ll) and Mach-O (which defaults to PIC).
> 
> Close #139001

Maybe we can use a better example in the description? This example does not use "a" modifier.

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


More information about the llvm-commits mailing list