[PATCH] D109203: [X86] Don't clobber EBX in stackprobes
Elliot Saba via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 3 10:26:12 PDT 2021
staticfloat updated this revision to Diff 370622.
staticfloat added a comment.
Fix test, address review comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109203/new/
https://reviews.llvm.org/D109203
Files:
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/test/CodeGen/X86/stack-clash-large.ll
Index: llvm/test/CodeGen/X86/stack-clash-large.ll
===================================================================
--- llvm/test/CodeGen/X86/stack-clash-large.ll
+++ llvm/test/CodeGen/X86/stack-clash-large.ll
@@ -35,12 +35,12 @@
; CHECK-X86-32-LABEL: foo:
; CHECK-X86-32: # %bb.0:
-; CHECK-X86-32-NEXT: movl %esp, %r11d
-; CHECK-X86-32-NEXT: subl $69632, %r11d # imm = 0x11000
+; CHECK-X86-32-NEXT: movl %esp, %eax
+; CHECK-X86-32-NEXT: subl $69632, %eax # imm = 0x11000
; CHECK-X86-32-NEXT: .LBB0_1: # =>This Inner Loop Header: Depth=1
; CHECK-X86-32-NEXT: subl $4096, %esp # imm = 0x1000
; CHECK-X86-32-NEXT: movl $0, (%esp)
-; CHECK-X86-32-NEXT: cmpl %r11d, %esp
+; CHECK-X86-32-NEXT: cmpl %eax, %esp
; CHECK-X86-32-NEXT: jne .LBB0_1
; CHECK-X86-32-NEXT:# %bb.2:
; CHECK-X86-32-NEXT: subl $2380, %esp
Index: llvm/lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- llvm/lib/Target/X86/X86FrameLowering.cpp
+++ llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -652,7 +652,8 @@
MF.insert(MBBIter, testMBB);
MF.insert(MBBIter, tailMBB);
- Register FinalStackProbed = Uses64BitFramePtr ? X86::R11 : X86::R11D;
+ Register FinalStackProbed =
+ Uses64BitFramePtr ? X86::R11 : Is64Bit ? X86::R11D : X86::EAX;
BuildMI(MBB, MBBI, DL, TII.get(TargetOpcode::COPY), FinalStackProbed)
.addReg(StackPtr)
.setMIFlag(MachineInstr::FrameSetup);
@@ -1073,7 +1074,8 @@
MF.insert(MBBIter, bodyMBB);
MF.insert(MBBIter, footMBB);
const unsigned MovMIOpc = Is64Bit ? X86::MOV64mi32 : X86::MOV32mi;
- Register FinalStackProbed = Uses64BitFramePtr ? X86::R11 : X86::R11D;
+ Register FinalStackProbed =
+ Uses64BitFramePtr ? X86::R11 : Is64Bit ? X86::R11D : X86::EAX;
// Setup entry block
{
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109203.370622.patch
Type: text/x-patch
Size: 1885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210903/e0361128/attachment.bin>
More information about the llvm-commits
mailing list