diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-06-17 02:16:43 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-06-17 02:16:43 +0000 |
commit | cd4e0b593db6dfdb5cedbde47ea6603058b8ac6c (patch) | |
tree | 12a5a8ead648e2cb789be67a9807cd8ed0feafc0 | |
parent | e1fd84af7affc08cda70a4c8261f52ac83195bc4 (diff) |
Update an insertion point iterator after replacing a return instruction with a
tail call pseudoinstruction. This fixes <rdar://problem/9624333>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133227 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMFrameLowering.cpp | 1 | ||||
-rw-r--r-- | test/CodeGen/ARM/2011-06-16-TailCallByVal.ll | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMFrameLowering.cpp b/lib/Target/ARM/ARMFrameLowering.cpp index 516e34ae04..4ef26660a7 100644 --- a/lib/Target/ARM/ARMFrameLowering.cpp +++ b/lib/Target/ARM/ARMFrameLowering.cpp @@ -427,6 +427,7 @@ void ARMFrameLowering::emitEpilogue(MachineFunction &MF, // Delete the pseudo instruction TCRETURN. MBB.erase(MBBI); + MBBI = NewMI; } if (VARegSaveSize) diff --git a/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll b/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll new file mode 100644 index 0000000000..7baacfe79a --- /dev/null +++ b/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll @@ -0,0 +1,20 @@ +; RUN: llc < %s -arm-tail-calls=1 | FileCheck %s +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32" +target triple = "thumbv7-apple-darwin10" + +%struct.A = type <{ i16, i16, i32, i16, i16, i32, i16, [8 x %struct.B], [418 x i8], %struct.C }> +%struct.B = type <{ i32, i16, i16 }> +%struct.C = type { i16, i32, i16, i16 } + +; CHECK: f +; CHECK: push {r1, r2, r3} +; CHECK: add sp, #12 +; CHECK: b.w _puts + +define void @f(i8* %s, %struct.A* nocapture byval %a) nounwind optsize { +entry: + %puts = tail call i32 @puts(i8* %s) + ret void +} + +declare i32 @puts(i8* nocapture) nounwind |