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

Commit

Permalink
Merge pull request #135 from goffrie/pr40289
Browse files Browse the repository at this point in the history
Cherry-pick a fix for LLVM issue 40289
  • Loading branch information
alexcrichton committed Jan 15, 2019
2 parents b490116 + 450fbb5 commit 8ba358c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Target/X86/X86FrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ static unsigned findDeadCallerSavedReg(MachineBasicBlock &MBB,
}

for (auto CS : AvailableRegs)
if (!Uses.count(CS) && CS != X86::RIP)
if (!Uses.count(CS) && CS != X86::RIP && CS != X86::RSP &&
CS != X86::ESP)
return CS;
}
}
Expand Down
9 changes: 9 additions & 0 deletions test/CodeGen/X86/pr40289-64bit.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc | FileCheck %s

define cc 92 < 9 x i64 > @clobber() {
%1 = alloca i64
%2 = load volatile i64, i64* %1
; CHECK-NOT: popq %rsp
; CHECK: addq $8, %rsp
ret < 9 x i64 > undef
}
9 changes: 9 additions & 0 deletions test/CodeGen/X86/pr40289.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; RUN: llc < %s -mtriple=i686-pc-windows-msvc | FileCheck %s

define < 3 x i32 > @clobber() {
%1 = alloca i32
%2 = load volatile i32, i32* %1
; CHECK-NOT: popl %esp
; CHECK: addl $4, %esp
ret < 3 x i32 > undef
}

0 comments on commit 8ba358c

Please sign in to comment.