[llvm-commits] [llvm] r133227 - in /llvm/trunk: lib/Target/ARM/ARMFrameLowering.cpp test/CodeGen/ARM/2011-06-16-TailCallByVal.ll
Cameron Zwarich
zwarich at apple.com
Thu Jun 16 19:16:43 PDT 2011
Author: zwarich
Date: Thu Jun 16 21:16:43 2011
New Revision: 133227
URL: http://llvm.org/viewvc/llvm-project?rev=133227&view=rev
Log:
Update an insertion point iterator after replacing a return instruction with a
tail call pseudoinstruction. This fixes <rdar://problem/9624333>.
Added:
llvm/trunk/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll
Modified:
llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp?rev=133227&r1=133226&r2=133227&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp Thu Jun 16 21:16:43 2011
@@ -427,6 +427,7 @@
// Delete the pseudo instruction TCRETURN.
MBB.erase(MBBI);
+ MBBI = NewMI;
}
if (VARegSaveSize)
Added: llvm/trunk/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll?rev=133227&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2011-06-16-TailCallByVal.ll Thu Jun 16 21:16:43 2011
@@ -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
More information about the llvm-commits
mailing list