[llvm] [llvm] Win x64 Unwind V2 1/n: Mark beginning and end of epilogs (PR #110024)

Daniel Paoliello via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 12:32:41 PDT 2024


================
@@ -178,12 +188,16 @@ define i32 @loopInfoSaveOutsideLoop2(i32 %cond, i32 %N) #0 {
 ; DISABLE-NEXT:    nop
 ; DISABLE-NEXT:    #NO_APP
 ; DISABLE-NEXT:    shll $3, %eax
-; DISABLE-NEXT:    jmp .LBB1_5
-; DISABLE-NEXT:  .LBB1_4: # %if.else
+; DISABLE-NEXT:    .seh_startepilogue
+; DISABLE-NEXT:    popq %rbx
+; DISABLE-NEXT:    .seh_endepilogue
+; DISABLE-NEXT:    retq
+; DISABLE-NEXT:  .LBB1_5: # %if.else
 ; DISABLE-NEXT:    addl %edx, %edx
 ; DISABLE-NEXT:    movl %edx, %eax
-; DISABLE-NEXT:  .LBB1_5: # %if.end
----------------
dpaoliello wrote:

I did - the SEH instructions weren't marked as being meta-instructions, so when I first added the new instructions it broke some of the "taildup" tests.

After I marked them as meta-instructions, this test changed - presumably because it now sees the `jmp` is no longer profitable because it knows the SEH instructions won't produce real instructions (before my change `.seh_epilogue` was still being emitted where `.seh_startepilogue` now is, but it wasn't being streamed into the ASM listing).

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


More information about the llvm-commits mailing list