summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-07-16 14:29:57 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-07-16 14:29:57 +0000
commitbc2ead6ea30df38dc5ea58aefea538f82fee881a (patch)
treea944d75ad115453a31e63e3c11699ab22a938efd
parent3729850b5029f37ab2294b5a091b14344a870551 (diff)
downloadbcm5719-llvm-bc2ead6ea30df38dc5ea58aefea538f82fee881a.tar.gz
bcm5719-llvm-bc2ead6ea30df38dc5ea58aefea538f82fee881a.zip
Fix incomin arg stack frame offset in case we need to generate stack frame
llvm-svn: 76049
-rw-r--r--llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp2
-rw-r--r--llvm/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll22
2 files changed, 23 insertions, 1 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
index ab92ebb89e8..c829e43fb17 100644
--- a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
@@ -101,7 +101,7 @@ int SystemZRegisterInfo::getFrameIndexOffset(MachineFunction &MF, int FI) const
Offset += StackSize - TFI.getOffsetOfLocalArea();
// Skip the register save area if we generated the stack frame.
- if (StackSize)
+ if (StackSize || MFI->hasCalls())
Offset -= TFI.getOffsetOfLocalArea();
return Offset;
diff --git a/llvm/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll b/llvm/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll
new file mode 100644
index 00000000000..6c86764073e
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llc | grep 328
+
+target datalayout = "E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16"
+target triple = "s390x-linux"
+
+declare void @rdft(i32 signext, i32 signext, double*, i32* nocapture, double*) nounwind
+
+declare double @mp_mul_d2i_test(i32 signext, i32 signext, double* nocapture) nounwind
+
+define void @mp_mul_radix_test_bb3(i32 %radix, i32 %nfft, double* %tmpfft, i32* %ip, double* %w, double* %arrayidx44.reload, double* %call.out) nounwind {
+newFuncRoot:
+ br label %bb3
+
+bb4.exitStub: ; preds = %bb3
+ store double %call, double* %call.out
+ ret void
+
+bb3: ; preds = %newFuncRoot
+ tail call void @rdft(i32 signext %nfft, i32 signext -1, double* %arrayidx44.reload, i32* %ip, double* %w) nounwind
+ %call = tail call double @mp_mul_d2i_test(i32 signext %radix, i32 signext %nfft, double* %tmpfft) ; <double> [#uses=1]
+ br label %bb4.exitStub
+}
OpenPOWER on IntegriCloud