aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/multiple-loop-post-inc.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-08 05:57:57 +0000
committerDan Gohman <gohman@apple.com>2010-04-08 05:57:57 +0000
commit701a4aef7fa0ece4dc1fdbc88b981820564cb4e4 (patch)
tree42e8019595b982abefb76583f62dfa37bda9cbab /test/CodeGen/X86/multiple-loop-post-inc.ll
parent4038f9c21b17378617c25f3092fe615326f8b874 (diff)
downloadexternal_llvm-701a4aef7fa0ece4dc1fdbc88b981820564cb4e4.zip
external_llvm-701a4aef7fa0ece4dc1fdbc88b981820564cb4e4.tar.gz
external_llvm-701a4aef7fa0ece4dc1fdbc88b981820564cb4e4.tar.bz2
When expanding expressions which are using post-inc mode for multiple loops,
ensure that the expansion is dominated by the increments of those loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/multiple-loop-post-inc.ll')
-rw-r--r--test/CodeGen/X86/multiple-loop-post-inc.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/X86/multiple-loop-post-inc.ll b/test/CodeGen/X86/multiple-loop-post-inc.ll
index 5feab18..51a0611 100644
--- a/test/CodeGen/X86/multiple-loop-post-inc.ll
+++ b/test/CodeGen/X86/multiple-loop-post-inc.ll
@@ -275,3 +275,30 @@ bb14: ; preds = %bb12, %bb11
return: ; preds = %entry
ret void
}
+
+; Codegen shouldn't crash on this testcase.
+
+define void @bar(i32 %a, i32 %b) nounwind {
+entry: ; preds = %bb1, %entry, %for.end204
+ br label %outer
+
+outer: ; preds = %bb1, %entry
+ %i6 = phi i32 [ %storemerge171, %bb1 ], [ %a, %entry ] ; <i32> [#uses=2]
+ %storemerge171 = add i32 %i6, 1 ; <i32> [#uses=1]
+ br label %inner
+
+inner: ; preds = %bb0, %if.end275
+ %i8 = phi i32 [ %a, %outer ], [ %indvar.next159, %bb0 ] ; <i32> [#uses=2]
+ %t338 = load i32* undef ; <i32> [#uses=1]
+ %t191 = mul i32 %i8, %t338 ; <i32> [#uses=1]
+ %t179 = add i32 %i6, %t191 ; <i32> [#uses=1]
+ br label %bb0
+
+bb0: ; preds = %for.body332
+ %indvar.next159 = add i32 %i8, 1 ; <i32> [#uses=1]
+ br i1 undef, label %bb1, label %inner
+
+bb1: ; preds = %bb0, %outer
+ %midx.4 = phi i32 [ %t179, %bb0 ] ; <i32> [#uses=0]
+ br label %outer
+}