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

Cherry-pick a fix for LLVM issue 40289 #135

Merged
merged 1 commit into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}