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

Aleksandr Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 02:09:36 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
----------------
aleks-tmb wrote:

Done, thanks!

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


More information about the llvm-commits mailing list