[PATCH] D143812: [X86][Win64] Avoid statepoints prior to SEH epilogue
Markus Böck via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 13:47:36 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd464edde9571: [X86][Win64] Avoid statepoints prior to SEH epilogue (authored by zero9178).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143812/new/
https://reviews.llvm.org/D143812
Files:
llvm/lib/Target/X86/X86MCInstLower.cpp
llvm/test/CodeGen/X86/win64-seh-epilogue-statepoint.ll
Index: llvm/test/CodeGen/X86/win64-seh-epilogue-statepoint.ll
===================================================================
--- llvm/test/CodeGen/X86/win64-seh-epilogue-statepoint.ll
+++ llvm/test/CodeGen/X86/win64-seh-epilogue-statepoint.ll
@@ -9,6 +9,7 @@
; CHECK-NEXT: .seh_endprologue
; CHECK-NEXT: callq bar
; CHECK-NEXT: .Ltmp0:
+; CHECK-NEXT: nop
; CHECK-NEXT: addq $40, %rsp
; CHECK-NEXT: retq
; CHECK-NEXT: .seh_endproc
Index: llvm/lib/Target/X86/X86MCInstLower.cpp
===================================================================
--- llvm/lib/Target/X86/X86MCInstLower.cpp
+++ llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -2714,9 +2714,10 @@
for (MBBI = PrevCrossBBInst(MBBI);
MBBI != MachineBasicBlock::const_iterator();
MBBI = PrevCrossBBInst(MBBI)) {
- // Conservatively assume that pseudo instructions don't emit code and keep
- // looking for a call. We may emit an unnecessary nop in some cases.
- if (!MBBI->isPseudo()) {
+ // Pseudo instructions that aren't a call are assumed to not emit any
+ // code. If they do, we worst case generate unnecessary noops after a
+ // call.
+ if (MBBI->isCall() || !MBBI->isPseudo()) {
if (MBBI->isCall())
EmitAndCountInstruction(MCInstBuilder(X86::NOOP));
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143812.497783.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230215/121b1354/attachment.bin>
More information about the llvm-commits
mailing list