[llvm] [X86] Fix incorrect NOP insertion between fused instructions that breaks macro fusion (PR #155316)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 21:10:23 PDT 2025


================
@@ -0,0 +1,14 @@
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+
+# Exercise the case where fused instructions need to be aligned,
+# ensuring fusion is not broken by a NOP
+
+        .globl  f
+f:
+        .nops 27
+# CHECK:      20:       testq   %rcx, %rcx
+# CHECK:      23:       je
+        testq   %rcx, %rcx
+        je      .EXIT
+.EXIT:
+        ret
----------------
MaskRay wrote:

github warns about no EOL.

Suggest that we merge this into align-branch-fused.s. You can add a new text section to make the instructions separate from the other tests.

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


More information about the llvm-commits mailing list