Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 8ba358c

Browse files
authored
Merge pull request #135 from goffrie/pr40289
Cherry-pick a fix for LLVM issue 40289
2 parents b490116 + 450fbb5 commit 8ba358c

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

lib/Target/X86/X86FrameLowering.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ static unsigned findDeadCallerSavedReg(MachineBasicBlock &MBB,
185185
}
186186

187187
for (auto CS : AvailableRegs)
188-
if (!Uses.count(CS) && CS != X86::RIP)
188+
if (!Uses.count(CS) && CS != X86::RIP && CS != X86::RSP &&
189+
CS != X86::ESP)
189190
return CS;
190191
}
191192
}

test/CodeGen/X86/pr40289-64bit.ll

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s
2+
3+
define cc 92 < 9 x i64 > @clobber() {
4+
%1 = alloca i64
5+
%2 = load volatile i64, i64* %1
6+
; CHECK-NOT: popq %rsp
7+
; CHECK: addq $8, %rsp
8+
ret < 9 x i64 > undef
9+
}

test/CodeGen/X86/pr40289.ll

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s
2+
3+
define < 3 x i32 > @clobber() {
4+
%1 = alloca i32
5+
%2 = load volatile i32, i32* %1
6+
; CHECK-NOT: popl %esp
7+
; CHECK: addl $4, %esp
8+
ret < 3 x i32 > undef
9+
}

0 commit comments

Comments
 (0)