[llvm] [TargetInstrInfo] Enable instruction size verification by default (PR #221687)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 23:58:19 PDT 2026


nikic wrote:

IR test case:
```llvm
; RUN: llc -filetype=obj
target triple = "aarch64-unknown-windows-msvc19.33.0"

define void @test() personality ptr @__C_specific_handler {
entry:
  %a = alloca i32, align 4
  invoke void @llvm.seh.try.begin()
          to label %invoke.cont unwind label %catch.dispatch

invoke.cont:
  %a.val = load volatile i32, ptr %a, align 4
  invoke void @llvm.seh.try.end()
          to label %exit unwind label %catch.dispatch

catch.dispatch:
  %cs = catchswitch within none [label %__except.ret] unwind to caller

__except.ret:
  %cp = catchpad within %cs [ptr @filt]
  catchret from %cp to label %exit

exit:
  ret void
}

declare i32 @filt(ptr %exception_pointers, ptr %frame_pointer)

declare i32 @__C_specific_handler(...)

!llvm.module.flags = !{!1}
!1 = !{i32 2, !"eh-asynch", i32 1}
```
The problem is this: https://github.com/llvm/llvm-project/blob/6526e5bc64b15efd1c972f6035f34a432637948e/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L2182-L2194

X86 is not affected because it does not report instruction sizes.

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


More information about the llvm-commits mailing list