aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-03-24 04:52:10 +0000
committerCameron Zwarich <zwarich@apple.com>2011-03-24 04:52:10 +0000
commit6e8ffc1c4d73e6c91aca9ac28ef5859ead26e2b6 (patch)
treed5f22038c241ffa03f8694cc0c0d2baed8a78b40 /test/CodeGen
parent4bae588c75fbd6d1b8401d83a94ba64fcc381d95 (diff)
downloadexternal_llvm-6e8ffc1c4d73e6c91aca9ac28ef5859ead26e2b6.zip
external_llvm-6e8ffc1c4d73e6c91aca9ac28ef5859ead26e2b6.tar.gz
external_llvm-6e8ffc1c4d73e6c91aca9ac28ef5859ead26e2b6.tar.bz2
Do early taildup of ret in CodeGenPrepare for potential tail calls that have a
void return type. This fixes PR9487. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/tailcall-returndup-void.ll37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/CodeGen/X86/tailcall-returndup-void.ll b/test/CodeGen/X86/tailcall-returndup-void.ll
new file mode 100644
index 0000000..c1d6312
--- /dev/null
+++ b/test/CodeGen/X86/tailcall-returndup-void.ll
@@ -0,0 +1,37 @@
+; RUN: llc < %s -march=x86-64 | FileCheck %s
+; CHECK: rBM_info
+; CHECK-NOT: ret
+
+@sES_closure = external global [0 x i64]
+declare cc10 void @sEH_info(i64* noalias nocapture, i64* noalias nocapture, i64* noalias nocapture, i64, i64, i64) align 8
+
+define cc10 void @rBM_info(i64* noalias nocapture %Base_Arg, i64* noalias nocapture %Sp_Arg, i64* noalias nocapture %Hp_Arg, i64 %R1_Arg, i64 %R2_Arg, i64 %R3_Arg) nounwind align 8 {
+c263:
+ %ln265 = getelementptr inbounds i64* %Sp_Arg, i64 -2
+ %ln266 = ptrtoint i64* %ln265 to i64
+ %ln268 = icmp ult i64 %ln266, %R3_Arg
+ br i1 %ln268, label %c26a, label %n26p
+
+n26p: ; preds = %c263
+ br i1 icmp ne (i64 and (i64 ptrtoint ([0 x i64]* @sES_closure to i64), i64 7), i64 0), label %c1ZP.i, label %n1ZQ.i
+
+n1ZQ.i: ; preds = %n26p
+ %ln1ZT.i = load i64* getelementptr inbounds ([0 x i64]* @sES_closure, i64 0, i64 0), align 8
+ %ln1ZU.i = inttoptr i64 %ln1ZT.i to void (i64*, i64*, i64*, i64, i64, i64)*
+ tail call cc10 void %ln1ZU.i(i64* %Base_Arg, i64* %Sp_Arg, i64* %Hp_Arg, i64 ptrtoint ([0 x i64]* @sES_closure to i64), i64 ptrtoint ([0 x i64]* @sES_closure to i64), i64 %R3_Arg) nounwind
+ br label %rBL_info.exit
+
+c1ZP.i: ; preds = %n26p
+ tail call cc10 void @sEH_info(i64* %Base_Arg, i64* %Sp_Arg, i64* %Hp_Arg, i64 ptrtoint ([0 x i64]* @sES_closure to i64), i64 ptrtoint ([0 x i64]* @sES_closure to i64), i64 %R3_Arg) nounwind
+ br label %rBL_info.exit
+
+rBL_info.exit: ; preds = %c1ZP.i, %n1ZQ.i
+ ret void
+
+c26a: ; preds = %c263
+ %ln27h = getelementptr inbounds i64* %Base_Arg, i64 -2
+ %ln27j = load i64* %ln27h, align 8
+ %ln27k = inttoptr i64 %ln27j to void (i64*, i64*, i64*, i64, i64, i64)*
+ tail call cc10 void %ln27k(i64* %Base_Arg, i64* %Sp_Arg, i64* %Hp_Arg, i64 %R1_Arg, i64 %R2_Arg, i64 %R3_Arg) nounwind
+ ret void
+}