[clang] [llvm] Fix Windows EH IP2State tables (remove +1 bias) (PR #144745)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 10:39:34 PDT 2025


================
@@ -84,12 +84,12 @@ define void @pr66984(ptr %arg) personality ptr @__CxxFrameHandler3 {
 ; X86_64-NEXT:    movq %rcx, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
 ; X86_64-NEXT:  .Ltmp0:
 ; X86_64-NEXT:    callq throw
+; X86_64-NEXT:    nop
----------------
sivadeilra wrote:

Well, in this case, the following instruction is EH_LABEL.  We could use the same heuristic of "does this CALL have successors?" but in this case I checked, and `MI->getParent()->succ_empty()` is false, I assume because of the unwinding successor.

In this case, `MI->getParent()->succ_size() == 2`, I assume because `throw` is not marked `noreturn` and there is an edge to that `unreachable` block.  Would we see different IR with optimizations?

I've been using `succ_empty()` for "is this call no-return?", but clearly that isn't the best test.  Is there a better way to check for that, here?

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


More information about the llvm-commits mailing list