[all-commits] [llvm/llvm-project] d8a9bf: [X86] Fix inline asm modifier printing across dial...

ayrai-gb via All-commits all-commits at lists.llvm.org
Tue Jul 7 04:57:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d8a9bfb0b39d2d331bd6e587016c779552caaffc
      https://github.com/llvm/llvm-project/commit/d8a9bfb0b39d2d331bd6e587016c779552caaffc
  Author: ayrai-gb <ayrai at amd.com>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    M llvm/lib/Target/X86/X86AsmPrinter.cpp
    M llvm/test/CodeGen/X86/asm-modifier.ll

  Log Message:
  -----------
  [X86] Fix inline asm modifier printing across dialects (#204558)

X86AsmPrinter handles several inline asm operand modifiers differently
depending on whether the asm block uses AT&T or Intel syntax.

For `%a` and `%A`, the scalar/register operand path used AT&T
punctuation unconditionally. In Intel-dialect inline asm this could
print invalid forms such as `(rdi)` for an address operand or `*rdi` for
an indirect call operand.

For `%P`, `PrintAsmMemoryOperand` passed `"disp-only"` to both the Intel
and AT&T memory printers, but only the Intel path honored it for
global/symbol displacements with a base register. The AT&T path could
therefore print `g(%rdi)` even though `%P` requested displacement-only
output.

Make the affected X86 asm-printer paths dialect-aware/consistent:
- print Intel `%a` register operands as `[reg]`
- print Intel `%A` register operands without AT&T `*`
- make AT&T `%P` honor `"disp-only"` for global/symbol displacements,
matching the existing Intel behavior

Found via @jlebar's X86 LLVM bug-hunt / FuzzX effort.

cc @jlebar

Co-authored-by: Ayush Rai <your-email at amd.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list