diff options
Diffstat (limited to 'test/Transforms/LoopSimplify')
-rw-r--r-- | test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll | 20 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll | 8 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/ashr-crash.ll | 6 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/merge-exits.ll | 10 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/notify-scev.ll | 2 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/phi-node-simplify.ll | 22 | ||||
-rw-r--r-- | test/Transforms/LoopSimplify/preserve-scev.ll | 7 |
7 files changed, 39 insertions, 36 deletions
diff --git a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll index 73f0813..4a69067 100644 --- a/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll +++ b/test/Transforms/LoopSimplify/2003-08-15-PreheadersFail.ll @@ -8,29 +8,29 @@ target datalayout = "e-p:32:32" define i32 @_yylex() { br label %loopentry.0 loopentry.0: ; preds = %else.26, %0 - store i32* getelementptr ([16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr - %tmp.35 = load i32** @yy_state_ptr ; <i32*> [#uses=2] - %inc.0 = getelementptr i32* %tmp.35, i64 1 ; <i32*> [#uses=1] + store i32* getelementptr ([16386 x i32], [16386 x i32]* @yy_state_buf, i64 0, i64 0), i32** @yy_state_ptr + %tmp.35 = load i32*, i32** @yy_state_ptr ; <i32*> [#uses=2] + %inc.0 = getelementptr i32, i32* %tmp.35, i64 1 ; <i32*> [#uses=1] store i32* %inc.0, i32** @yy_state_ptr - %tmp.36 = load i32* null ; <i32> [#uses=1] + %tmp.36 = load i32, i32* null ; <i32> [#uses=1] store i32 %tmp.36, i32* %tmp.35 br label %loopexit.2 loopexit.2: ; preds = %else.26, %loopexit.2, %loopentry.0 store i8* null, i8** null - %tmp.91 = load i32* null ; <i32> [#uses=1] + %tmp.91 = load i32, i32* null ; <i32> [#uses=1] %tmp.92 = sext i32 %tmp.91 to i64 ; <i64> [#uses=1] - %tmp.93 = getelementptr [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1] - %tmp.94 = load i16* %tmp.93 ; <i16> [#uses=1] + %tmp.93 = getelementptr [787 x i16], [787 x i16]* @yy_base, i64 0, i64 %tmp.92 ; <i16*> [#uses=1] + %tmp.94 = load i16, i16* %tmp.93 ; <i16> [#uses=1] %tmp.95 = icmp ne i16 %tmp.94, 4394 ; <i1> [#uses=1] br i1 %tmp.95, label %loopexit.2, label %yy_find_action yy_find_action: ; preds = %else.26, %loopexit.2 br label %loopentry.3 loopentry.3: ; preds = %then.9, %shortcirc_done.0, %yy_find_action - %tmp.105 = load i32* @yy_lp ; <i32> [#uses=1] + %tmp.105 = load i32, i32* @yy_lp ; <i32> [#uses=1] %tmp.106 = icmp ne i32 %tmp.105, 0 ; <i1> [#uses=1] br i1 %tmp.106, label %shortcirc_next.0, label %shortcirc_done.0 shortcirc_next.0: ; preds = %loopentry.3 - %tmp.114 = load i16* null ; <i16> [#uses=1] + %tmp.114 = load i16, i16* null ; <i16> [#uses=1] %tmp.115 = sext i16 %tmp.114 to i32 ; <i32> [#uses=1] %tmp.116 = icmp slt i32 0, %tmp.115 ; <i1> [#uses=1] br label %shortcirc_done.0 @@ -38,7 +38,7 @@ shortcirc_done.0: ; preds = %shortcirc_next.0, %loopentry.3 %shortcirc_val.0 = phi i1 [ false, %loopentry.3 ], [ %tmp.116, %shortcirc_next.0 ] ; <i1> [#uses=1] br i1 %shortcirc_val.0, label %else.0, label %loopentry.3 else.0: ; preds = %shortcirc_done.0 - %tmp.144 = load i32* null ; <i32> [#uses=1] + %tmp.144 = load i32, i32* null ; <i32> [#uses=1] %tmp.145 = and i32 %tmp.144, 8192 ; <i32> [#uses=1] %tmp.146 = icmp ne i32 %tmp.145, 0 ; <i1> [#uses=1] br i1 %tmp.146, label %then.9, label %else.26 diff --git a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll index fb39f05..32b6322 100644 --- a/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll +++ b/test/Transforms/LoopSimplify/2003-12-10-ExitBlocksProblem.ll @@ -14,15 +14,15 @@ entry: store i32 123, i32* @G br label %loopentry.i loopentry.i: ; preds = %endif.1.i, %entry - %tmp.0.i = load i32* @G ; <i32> [#uses=1] + %tmp.0.i = load i32, i32* @G ; <i32> [#uses=1] %tmp.1.i = icmp eq i32 %tmp.0.i, 123 ; <i1> [#uses=1] br i1 %tmp.1.i, label %Out.i, label %endif.0.i endif.0.i: ; preds = %loopentry.i - %tmp.3.i = load i32* @G ; <i32> [#uses=1] + %tmp.3.i = load i32, i32* @G ; <i32> [#uses=1] %tmp.4.i = icmp eq i32 %tmp.3.i, 126 ; <i1> [#uses=1] br i1 %tmp.4.i, label %ExitBlock.i, label %endif.1.i endif.1.i: ; preds = %endif.0.i - %tmp.6.i = load i32* @G ; <i32> [#uses=1] + %tmp.6.i = load i32, i32* @G ; <i32> [#uses=1] %inc.i = add i32 %tmp.6.i, 1 ; <i32> [#uses=1] store i32 %inc.i, i32* @G br label %loopentry.i @@ -30,7 +30,7 @@ Out.i: ; preds = %loopentry.i store i32 0, i32* @G br label %ExitBlock.i ExitBlock.i: ; preds = %Out.i, %endif.0.i - %tmp.7.i = load i32* @G ; <i32> [#uses=1] + %tmp.7.i = load i32, i32* @G ; <i32> [#uses=1] ret i32 %tmp.7.i } diff --git a/test/Transforms/LoopSimplify/ashr-crash.ll b/test/Transforms/LoopSimplify/ashr-crash.ll index c58903d..b5cc144 100644 --- a/test/Transforms/LoopSimplify/ashr-crash.ll +++ b/test/Transforms/LoopSimplify/ashr-crash.ll @@ -51,10 +51,10 @@ for.cond1: ; preds = %for.cond, %for.body br i1 %cmp2, label %for.body3, label %for.inc7 for.body3: ; preds = %for.cond1 - %0 = load i32* @c, align 4 + %0 = load i32, i32* @c, align 4 %cmp4 = icmp sge i32 %storemerge1, %0 %conv = zext i1 %cmp4 to i32 - %1 = load i32* @d, align 4 + %1 = load i32, i32* @d, align 4 %add = add nsw i32 %conv, %1 %sext = shl i32 %add, 16 %conv6 = ashr exact i32 %sext, 16 @@ -63,7 +63,7 @@ for.body3: ; preds = %for.cond1 br label %for.cond1 for.inc7: ; preds = %for.cond1 - %2 = load i32* @d, align 4 + %2 = load i32, i32* @d, align 4 %inc8 = add nsw i32 %2, 1 br label %for.cond diff --git a/test/Transforms/LoopSimplify/merge-exits.ll b/test/Transforms/LoopSimplify/merge-exits.ll index 9678148..5cdf814 100644 --- a/test/Transforms/LoopSimplify/merge-exits.ll +++ b/test/Transforms/LoopSimplify/merge-exits.ll @@ -15,18 +15,18 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define float @test1(float* %pTmp1, float* %peakWeight, i32 %bandEdgeIndex) nounwind { entry: - %t0 = load float* %peakWeight, align 4 + %t0 = load float, float* %peakWeight, align 4 br label %bb1 bb: ; preds = %bb2 %t1 = sext i32 %hiPart.0 to i64 - %t2 = getelementptr float* %pTmp1, i64 %t1 - %t3 = load float* %t2, align 4 + %t2 = getelementptr float, float* %pTmp1, i64 %t1 + %t3 = load float, float* %t2, align 4 %t4 = fadd float %t3, %distERBhi.0 %t5 = add i32 %hiPart.0, 1 %t6 = sext i32 %t5 to i64 - %t7 = getelementptr float* %peakWeight, i64 %t6 - %t8 = load float* %t7, align 4 + %t7 = getelementptr float, float* %peakWeight, i64 %t6 + %t8 = load float, float* %t7, align 4 %t9 = fadd float %t8, %peakCount.0 br label %bb1 diff --git a/test/Transforms/LoopSimplify/notify-scev.ll b/test/Transforms/LoopSimplify/notify-scev.ll index ee8e2ee..059b589 100644 --- a/test/Transforms/LoopSimplify/notify-scev.ll +++ b/test/Transforms/LoopSimplify/notify-scev.ll @@ -60,7 +60,7 @@ for.inc172.us: br i1 undef, label %for.cond142.preheader.us, label %for.end174.us for.body145.us: - %arrayidx163.us = getelementptr inbounds %struct.Params* undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us + %arrayidx163.us = getelementptr inbounds %struct.Params, %struct.Params* undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us br i1 undef, label %for.body145.us, label %for.inc172.us for.cond142.preheader.us: diff --git a/test/Transforms/LoopSimplify/phi-node-simplify.ll b/test/Transforms/LoopSimplify/phi-node-simplify.ll index 8eb63d9..6536acb 100644 --- a/test/Transforms/LoopSimplify/phi-node-simplify.ll +++ b/test/Transforms/LoopSimplify/phi-node-simplify.ll @@ -12,29 +12,29 @@ entry: br label %loopentry.1 loopentry.1: ; preds = %loopexit.1, %entry %indvar20 = phi i32 [ 0, %entry ], [ %indvar.next21, %loopexit.1 ] ; <i32> [#uses=1] - %a.1 = phi i32* [ getelementptr ([3000000 x i32]* @A, i32 0, i32 0), %entry ], [ %inc.0, %loopexit.1 ] ; <i32*> [#uses=1] + %a.1 = phi i32* [ getelementptr ([3000000 x i32], [3000000 x i32]* @A, i32 0, i32 0), %entry ], [ %inc.0, %loopexit.1 ] ; <i32*> [#uses=1] br label %no_exit.2 no_exit.2: ; preds = %loopexit.2, %no_exit.2, %loopentry.1 %a.0.4.ph = phi i32* [ %a.1, %loopentry.1 ], [ %inc.0, %loopexit.2 ], [ %a.0.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] - %b.1.4.ph = phi i32* [ getelementptr ([20000 x i32]* @B, i32 0, i32 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] + %b.1.4.ph = phi i32* [ getelementptr ([20000 x i32], [20000 x i32]* @B, i32 0, i32 0), %loopentry.1 ], [ %inc.1, %loopexit.2 ], [ %b.1.4.ph, %no_exit.2 ] ; <i32*> [#uses=3] %indvar17 = phi i32 [ 0, %loopentry.1 ], [ %indvar.next18, %loopexit.2 ], [ %indvar17, %no_exit.2 ] ; <i32> [#uses=2] %indvar = phi i32 [ %indvar.next, %no_exit.2 ], [ 0, %loopexit.2 ], [ 0, %loopentry.1 ] ; <i32> [#uses=5] %b.1.4.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=1] %gep.upgrd.1 = zext i32 %indvar to i64 ; <i64> [#uses=1] - %c.2.4 = getelementptr [100 x i32]* @C, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %c.2.4 = getelementptr [100 x i32], [100 x i32]* @C, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] %gep.upgrd.2 = zext i32 %indvar to i64 ; <i64> [#uses=1] - %a.0.4 = getelementptr i32* %a.0.4.ph, i64 %gep.upgrd.2 ; <i32*> [#uses=1] + %a.0.4 = getelementptr i32, i32* %a.0.4.ph, i64 %gep.upgrd.2 ; <i32*> [#uses=1] %gep.upgrd.3 = zext i32 %indvar to i64 ; <i64> [#uses=1] - %b.1.4 = getelementptr i32* %b.1.4.ph, i64 %gep.upgrd.3 ; <i32*> [#uses=1] + %b.1.4 = getelementptr i32, i32* %b.1.4.ph, i64 %gep.upgrd.3 ; <i32*> [#uses=1] %inc.0.rec = add i32 %b.1.4.rec, 1 ; <i32> [#uses=2] - %inc.0 = getelementptr i32* %a.0.4.ph, i32 %inc.0.rec ; <i32*> [#uses=2] - %tmp.13 = load i32* %a.0.4 ; <i32> [#uses=1] - %inc.1 = getelementptr i32* %b.1.4.ph, i32 %inc.0.rec ; <i32*> [#uses=1] - %tmp.15 = load i32* %b.1.4 ; <i32> [#uses=1] - %tmp.18 = load i32* %c.2.4 ; <i32> [#uses=1] + %inc.0 = getelementptr i32, i32* %a.0.4.ph, i32 %inc.0.rec ; <i32*> [#uses=2] + %tmp.13 = load i32, i32* %a.0.4 ; <i32> [#uses=1] + %inc.1 = getelementptr i32, i32* %b.1.4.ph, i32 %inc.0.rec ; <i32*> [#uses=1] + %tmp.15 = load i32, i32* %b.1.4 ; <i32> [#uses=1] + %tmp.18 = load i32, i32* %c.2.4 ; <i32> [#uses=1] %tmp.16 = mul i32 %tmp.15, %tmp.13 ; <i32> [#uses=1] %tmp.19 = mul i32 %tmp.16, %tmp.18 ; <i32> [#uses=1] - %tmp.20 = load i32* @Z ; <i32> [#uses=1] + %tmp.20 = load i32, i32* @Z ; <i32> [#uses=1] %tmp.21 = add i32 %tmp.19, %tmp.20 ; <i32> [#uses=1] store i32 %tmp.21, i32* @Z %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/LoopSimplify/preserve-scev.ll b/test/Transforms/LoopSimplify/preserve-scev.ll index 89626b2..f6fa8af 100644 --- a/test/Transforms/LoopSimplify/preserve-scev.ll +++ b/test/Transforms/LoopSimplify/preserve-scev.ll @@ -1,6 +1,9 @@ ; RUN: opt -S < %s -indvars | opt -analyze -iv-users | grep "%cmp = icmp slt i32" | grep "= {%\.ph,+,1}<%for.cond>" ; PR8079 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + ; LoopSimplify should invalidate indvars when splitting out the ; inner loop. @@ -15,7 +18,7 @@ for.cond: ; preds = %if.then5, %if.end, %0 = phi i32 [ 0, %entry ], [ %add, %if.end ], [ %add, %if.then5 ] %add = add i32 %0, 1 %cmp = icmp slt i32 %0, 1 - %tmp1 = load i32* @maxStat, align 4 + %tmp1 = load i32, i32* @maxStat, align 4 br i1 %cmp, label %for.body, label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond @@ -39,7 +42,7 @@ for.body18: ; preds = %for.body18, %for.co %i13.027 = phi i32 [ %1, %for.body18 ], [ 0, %for.cond14.preheader ] call void @foo() nounwind %1 = add nsw i32 %i13.027, 1 - %tmp16 = load i32* @maxStat, align 4 + %tmp16 = load i32, i32* @maxStat, align 4 %cmp17 = icmp slt i32 %1, %tmp16 br i1 %cmp17, label %for.body18, label %return |