diff options
Diffstat (limited to 'test/Transforms/LoopStrengthReduce')
69 files changed, 451 insertions, 398 deletions
diff --git a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll index 1f08a43..7ee1e63 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-15-AddRecIV.ll @@ -48,9 +48,9 @@ loopexit.3: ; preds = %loopentry.3 loopentry.4: ; preds = %loopentry.4, %loopexit.3 %indvar340 = phi i32 [ 0, %loopexit.3 ], [ %indvar.next341, %loopentry.4 ] ; <i32> [#uses=2] %tmp. = add i32 %indvar340, %indvar342 ; <i32> [#uses=1] - %tmp.526 = load i32** null ; <i32*> [#uses=1] + %tmp.526 = load i32*, i32** null ; <i32*> [#uses=1] %gep.upgrd.1 = zext i32 %tmp. to i64 ; <i64> [#uses=1] - %tmp.528 = getelementptr i32* %tmp.526, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %tmp.528 = getelementptr i32, i32* %tmp.526, i64 %gep.upgrd.1 ; <i32*> [#uses=1] store i32 0, i32* %tmp.528 %indvar.next341 = add i32 %indvar340, 1 ; <i32> [#uses=1] br label %loopentry.4 diff --git a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll index f1c523a..3e52dff 100644 --- a/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll +++ b/test/Transforms/LoopStrengthReduce/2005-08-17-OutOfLoopVariant.ll @@ -6,7 +6,7 @@ loopentry.1.outer: br label %loopentry.1 loopentry.1: ; preds = %loopentry.1, %loopentry.1.outer %i.3 = phi i32 [ 0, %loopentry.1.outer ], [ %i.3.be, %loopentry.1 ] ; <i32> [#uses=2] - %tmp.390 = load i32* null ; <i32> [#uses=1] + %tmp.390 = load i32, i32* null ; <i32> [#uses=1] %tmp.392 = mul i32 %tmp.390, %j.2.1.ph ; <i32> [#uses=1] %tmp.394 = add i32 %tmp.392, %i.3 ; <i32> [#uses=1] %i.3.be = add i32 %i.3, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll b/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll index 8c2cfaf..44f9801 100644 --- a/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll +++ b/test/Transforms/LoopStrengthReduce/2007-04-23-UseIterator.ll @@ -24,7 +24,7 @@ bb16: ; preds = %cond_next102, %bb16.preheader cond_next102: ; preds = %bb16 %tmp138145.rec = add i32 %ABC.2146.0.rec, 3 ; <i32> [#uses=1] - %tmp138145 = getelementptr i8* %ABC, i32 %tmp138145.rec ; <i8*> [#uses=4] + %tmp138145 = getelementptr i8, i8* %ABC, i32 %tmp138145.rec ; <i8*> [#uses=4] %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1] switch i8 0, label %bb129.loopexit [ i8 0, label %UnifiedReturnBlock.loopexit diff --git a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll index ce56bd3..d1454cf 100644 --- a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll +++ b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -loop-reduce -S | grep add | count 2 ; PR 2662 + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + @g_3 = common global i16 0 ; <i16*> [#uses=2] @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] @@ -22,9 +26,9 @@ return: ; preds = %bb define i32 @main() nounwind { entry: tail call void @func_1( ) nounwind - load volatile i16* @g_3, align 2 ; <i16>:0 [#uses=1] + load volatile i16, i16* @g_3, align 2 ; <i16>:0 [#uses=1] zext i16 %0 to i32 ; <i32>:1 [#uses=1] - tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %1 ) nounwind ; <i32>:2 [#uses=0] + tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %1 ) nounwind ; <i32>:2 [#uses=0] ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll index 1ee6b5c..481569c 100644 --- a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll +++ b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -loop-reduce -S | grep phi | count 2 ; PR 2779 + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + @g_19 = common global i32 0 ; <i32*> [#uses=3] @"\01LC" = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] @@ -21,7 +25,7 @@ bb: ; preds = %bb, %entry %indvar = phi i16 [ 0, %entry ], [ %indvar.next, %bb ] ; <i16> [#uses=2] %tmp = sub i16 0, %indvar ; <i16> [#uses=1] %tmp27 = trunc i16 %tmp to i8 ; <i8> [#uses=1] - load i32* @g_19, align 4 ; <i32>:0 [#uses=2] + load i32, i32* @g_19, align 4 ; <i32>:0 [#uses=2] add i32 %0, 1 ; <i32>:1 [#uses=1] store i32 %1, i32* @g_19, align 4 trunc i32 %0 to i8 ; <i8>:2 [#uses=1] @@ -40,8 +44,8 @@ return: ; preds = %bb define i32 @main() nounwind { entry: tail call void @func_1( ) nounwind - load i32* @g_19, align 4 ; <i32>:0 [#uses=1] - tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @"\01LC", i32 0, i32 0), i32 %0 ) nounwind ; <i32>:1 [#uses=0] + load i32, i32* @g_19, align 4 ; <i32>:0 [#uses=1] + tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %0 ) nounwind ; <i32>:1 [#uses=0] ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll index b2cf818..8304f76 100644 --- a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll +++ b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll @@ -26,14 +26,14 @@ bb1.i: ; preds = %bb.i2, %entry br i1 %0, label %bb2.i3, label %nactive_heaps.exit bb2.i3: ; preds = %bb1.i - %1 = load %struct.obj** null, align 4 ; <%struct.obj*> [#uses=1] + %1 = load %struct.obj*, %struct.obj** null, align 4 ; <%struct.obj*> [#uses=1] %2 = icmp eq %struct.obj* %1, null ; <i1> [#uses=1] br i1 %2, label %nactive_heaps.exit, label %bb.i2 nactive_heaps.exit: ; preds = %bb2.i3, %bb1.i - %3 = load i32* @heap_size, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* @heap_size, align 4 ; <i32> [#uses=1] %4 = mul i32 %3, %m.0.i ; <i32> [#uses=1] %5 = sub i32 %4, 0 ; <i32> [#uses=1] - %6 = tail call i32 (i8*, i8*, ...)* @sprintf(i8* null, i8* getelementptr ([39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; <i32> [#uses=0] + %6 = tail call i32 (i8*, i8*, ...)* @sprintf(i8* null, i8* getelementptr ([39 x i8], [39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; <i32> [#uses=0] ret %struct.obj* null } diff --git a/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll b/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll index 002a878..8e890e8 100644 --- a/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll +++ b/test/Transforms/LoopStrengthReduce/2009-04-28-no-reduce-mul.ll @@ -21,7 +21,7 @@ bb2: ; preds = %bb4, %bb2, %bb4.thread %0 = trunc i32 %j.0.reg2mem.0 to i8 ; <i8> [#uses=1] %1 = sext i8 %0 to i32 ; <i32> [#uses=1] %2 = mul i32 %1, %i.0.reg2mem.0.ph ; <i32> [#uses=1] - %3 = getelementptr [32 x [256 x i32]]* @table, i32 0, i32 %i.0.reg2mem.0.ph, i32 %j.0.reg2mem.0 ; <i32*> [#uses=1] + %3 = getelementptr [32 x [256 x i32]], [32 x [256 x i32]]* @table, i32 0, i32 %i.0.reg2mem.0.ph, i32 %j.0.reg2mem.0 ; <i32*> [#uses=1] store i32 %2, i32* %3, align 4 %indvar.next = add i32 %j.0.reg2mem.0, 1 ; <i32> [#uses=2] %exitcond = icmp eq i32 %indvar.next, 256 ; <i1> [#uses=1] @@ -33,7 +33,7 @@ bb4: ; preds = %bb2 br i1 %exitcond10, label %bb5, label %bb2 bb5: ; preds = %bb4 - %4 = load i32* getelementptr ([32 x [256 x i32]]* @table, i32 0, i32 9, i32 132), align 16 ; <i32> [#uses=1] + %4 = load i32, i32* getelementptr ([32 x [256 x i32]], [32 x [256 x i32]]* @table, i32 0, i32 9, i32 132), align 16 ; <i32> [#uses=1] %5 = icmp eq i32 %4, -1116 ; <i1> [#uses=1] br i1 %5, label %bb7, label %bb6 diff --git a/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll b/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll index b9bd7c9..cf549fc 100644 --- a/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll +++ b/test/Transforms/LoopStrengthReduce/2011-07-19-CritEdgeBreakCrash.ll @@ -24,12 +24,12 @@ H_MPZ_LBL: ; preds = %indirectgoto while.cond.i: ; preds = %while.body.i15795, %if.then.i15791 %phi = phi i64 [ %tmp20916, %while.body.i15795 ], [ 0, %H_MPZ_LBL ] %tmp20916 = add i64 %phi, 1 - %incdec.ptr.i15793 = getelementptr i64* %pc.0.lcssa.i1610719352, i64 %tmp20916 + %incdec.ptr.i15793 = getelementptr i64, i64* %pc.0.lcssa.i1610719352, i64 %tmp20916 %boo2 = call i1 @foo() br i1 %boo2, label %indirectgoto, label %while.body.i15795 while.body.i15795: ; preds = %while.cond.i - %tmp20.i = load i64* %incdec.ptr.i15793, align 8 + %tmp20.i = load i64, i64* %incdec.ptr.i15793, align 8 %boo1 = call i1 @foo() br i1 %boo1, label %while.cond.i, label %body_failed diff --git a/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll b/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll index ccf8ebd..5588995 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll @@ -4,6 +4,10 @@ target triple = "x86-apple-darwin" +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; Verify that identical edges are merged. rdar://problem/6453893 ; CHECK-LABEL: @test1( ; CHECK: bb89: @@ -16,7 +20,7 @@ entry: loop: %rec = phi i32 [ %next, %loop ], [ 0, %entry ] %next = add i32 %rec, 1 - %tmp75 = getelementptr i8* null, i32 %next + %tmp75 = getelementptr i8, i8* null, i32 %next br i1 false, label %loop, label %loopexit loopexit: @@ -53,7 +57,7 @@ entry: loop: %rec = phi i32 [ %next, %loop ], [ 0, %entry ] %next = add i32 %rec, 1 - %tmp75 = getelementptr i8* null, i32 %next + %tmp75 = getelementptr i8, i8* null, i32 %next br i1 false, label %loop, label %loopexit loopexit: diff --git a/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll b/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll index 83963e3..cc8226e 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll @@ -5,6 +5,10 @@ target triple = "x86-apple-darwin" +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; CHECK-LABEL: @test( ; multiplies are hoisted out of the loop ; CHECK: while.body.lr.ph: @@ -17,10 +21,10 @@ target triple = "x86-apple-darwin" ; CHECK: phi ; CHECK: phi ; CHECK-NOT: phi -; CHECK: bitcast float* {{.*}} to i8* -; CHECK: bitcast float* {{.*}} to i8* -; CHECK: getelementptr i8* -; CHECK: getelementptr i8* +; CHECK: bitcast float* {{.*}} to i1* +; CHECK: bitcast float* {{.*}} to i1* +; CHECK: getelementptr i1, i1* +; CHECK: getelementptr i1, i1* define float @test(float* nocapture %A, float* nocapture %B, i32 %N, i32 %IA, i32 %IB) nounwind uwtable readonly ssp { entry: @@ -37,12 +41,12 @@ while.body: ; preds = %while.body.lr.ph, % %B.addr.04 = phi float* [ %B, %while.body.lr.ph ], [ %add.ptr3, %while.body ] %N.addr.03 = phi i32 [ %N, %while.body.lr.ph ], [ %sub, %while.body ] %Sum0.02 = phi float [ 0.000000e+00, %while.body.lr.ph ], [ %add, %while.body ] - %0 = load float* %A.addr.05, align 4 - %1 = load float* %B.addr.04, align 4 + %0 = load float, float* %A.addr.05, align 4 + %1 = load float, float* %B.addr.04, align 4 %mul = fmul float %0, %1 %add = fadd float %Sum0.02, %mul - %add.ptr = getelementptr inbounds float* %A.addr.05, i64 %idx.ext - %add.ptr3 = getelementptr inbounds float* %B.addr.04, i64 %idx.ext2 + %add.ptr = getelementptr inbounds float, float* %A.addr.05, i64 %idx.ext + %add.ptr3 = getelementptr inbounds float, float* %B.addr.04, i64 %idx.ext2 %sub = add nsw i32 %N.addr.03, -1 %cmp = icmp sgt i32 %sub, 0 br i1 %cmp, label %while.body, label %while.end diff --git a/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll b/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll index 484fefa..a61de24 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-13-SCEVChain.ll @@ -95,14 +95,14 @@ bb1: %t15 = icmp ugt i32 %n15, -4 %m15 = select i1 %t15, i32 %n15, i32 -4 %a16 = add i32 %m15, %a15 - %gep = getelementptr i8* %base, i32 %a16 + %gep = getelementptr i8, i8* %base, i32 %a16 %ofs = add i32 %a16, 4 - %limit = getelementptr i8* %base, i32 %ofs + %limit = getelementptr i8, i8* %base, i32 %ofs br label %loop loop: %iv = phi i8* [ %gep, %bb1 ], [ %inc, %loop ] - %inc = getelementptr inbounds i8* %iv, i64 1 + %inc = getelementptr inbounds i8, i8* %iv, i64 1 %exitcond = icmp eq i8* %inc, %limit br i1 %exitcond, label %loop, label %exit diff --git a/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll b/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll index 068b716..fe9f8cb 100644 --- a/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll +++ b/test/Transforms/LoopStrengthReduce/2011-10-14-IntPtr.ll @@ -22,6 +22,6 @@ for.end: ; preds = %for.end.critedge, % for.body83: ; preds = %for.body83, %for.end %ptr.0157 = phi i8* [ %add.ptr96, %for.body83 ], [ null, %for.end ] store i8 undef, i8* %ptr.0157, align 1 - %add.ptr96 = getelementptr inbounds i8* %ptr.0157, i32 %cond + %add.ptr96 = getelementptr inbounds i8, i8* %ptr.0157, i32 %cond br label %for.body83 } diff --git a/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll b/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll index 6c128fe..317b0b0 100644 --- a/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll +++ b/test/Transforms/LoopStrengthReduce/2011-12-19-PostincQuadratic.ll @@ -15,7 +15,7 @@ target triple = "i386-unknown-freebsd10.0" ; Inner recurrence: ; CHECK: %lsr.iv = phi i32 ; Outer step (relative to inner recurrence): -; CHECK: %scevgep = getelementptr i1* %{{.*}}, i32 %lsr.iv +; CHECK: %scevgep = getelementptr i1, i1* %{{.*}}, i32 %lsr.iv ; Outer use: ; CHECK: %lsr.iv3 = phi [121 x i32]* [ %lsr.iv1, %for.body43.preheader ] define void @vb() nounwind { @@ -32,8 +32,8 @@ for.body7: for.body43: %bf.459 = phi i32 [ %inc44, %for.body43 ], [ %t1, %for.body7 ] %inc44 = add nsw i32 %bf.459, 1 - %arrayidx45 = getelementptr inbounds [121 x i32]* @b, i32 0, i32 %bf.459 - %t2 = load i32* %arrayidx45, align 4 + %arrayidx45 = getelementptr inbounds [121 x i32], [121 x i32]* @b, i32 0, i32 %bf.459 + %t2 = load i32, i32* %arrayidx45, align 4 br label %for.body43 } diff --git a/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll b/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll index 87dd397..d8aa264 100644 --- a/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll +++ b/test/Transforms/LoopStrengthReduce/2012-01-02-nopreheader.ll @@ -35,7 +35,7 @@ bb7.lr.ph.us: ; preds = %bb9.us, %bb8.prehea bb7.us: ; preds = %bb7.lr.ph.us, %bb7.us %j.01.us = phi i32 [ 0, %bb7.lr.ph.us ], [ %1, %bb7.us ] %tmp31 = add i32 %tmp30, %j.01.us - %scevgep9 = getelementptr float* %a, i32 %tmp31 + %scevgep9 = getelementptr float, float* %a, i32 %tmp31 store float undef, float* %scevgep9, align 1 %1 = add nsw i32 %j.01.us, 1 indirectbr i8* undef, [label %bb9.us, label %bb7.us] @@ -74,7 +74,7 @@ bb8.preheader: ; preds = %bb9, %bb3 bb7: ; preds = %bb8.preheader, %bb7 %indvar = phi i32 [ 0, %bb8.preheader ], [ %indvar.next, %bb7 ] - %scevgep = getelementptr [200 x i32]* %Array2, i32 %tmp26, i32 %indvar + %scevgep = getelementptr [200 x i32], [200 x i32]* %Array2, i32 %tmp26, i32 %indvar store i32 undef, i32* %scevgep, align 4 %indvar.next = add i32 %indvar, 1 indirectbr i8* undef, [label %bb9, label %bb7] diff --git a/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll b/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll index 94a037e..7f1eed0 100644 --- a/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll +++ b/test/Transforms/LoopStrengthReduce/2012-01-16-nopreheader.ll @@ -48,7 +48,7 @@ while.cond238.preheader: ; preds = %lor.lhs.false227, % while.cond238: ; preds = %land.rhs243, %while.cond238.preheader %1 = phi i64 [ %indvar.next15, %land.rhs243 ], [ 0, %while.cond238.preheader ] %tmp36 = add i64 %tmp16, %1 - %s.3 = getelementptr i8* %s.1, i64 %tmp36 + %s.3 = getelementptr i8, i8* %s.1, i64 %tmp36 %cmp241 = icmp ult i8* %s.3, %end indirectbr i8* undef, [label %land.rhs243, label %while.end256] @@ -75,7 +75,7 @@ if.end340: ; preds = %while.end334 indirectbr i8* undef, [label %PREMATURE, label %if.end348] if.end348: ; preds = %if.end340 - %incdec.ptr356 = getelementptr inbounds i8* undef, i64 2 + %incdec.ptr356 = getelementptr inbounds i8, i8* undef, i64 2 indirectbr i8* undef, [label %while.cond179] if.else386: ; preds = %if.else diff --git a/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll b/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll index 5fa3838..62064cb 100644 --- a/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll +++ b/test/Transforms/LoopStrengthReduce/2012-03-15-nopreheader.ll @@ -34,8 +34,8 @@ lor.lhs.false184: ; preds = %lor.lhs.false177 for.cond: ; preds = %for.inc, %lor.lhs.false184, %if.end152 %indvar65 = phi i64 [ %indvar.next66, %for.inc ], [ 0, %lor.lhs.false184 ], [ 0, %if.end152 ] %tmp128 = add i64 %0, %indvar65 - %s.4 = getelementptr i8* %cmd, i64 %tmp128 - %tmp195 = load i8* %s.4, align 1 + %s.4 = getelementptr i8, i8* %cmd, i64 %tmp128 + %tmp195 = load i8, i8* %s.4, align 1 indirectbr i8* undef, [label %return, label %land.rhs198] land.rhs198: ; preds = %for.cond diff --git a/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll b/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll index c9b11a9..ce6161c 100644 --- a/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll +++ b/test/Transforms/LoopStrengthReduce/2012-03-26-constexpr.ll @@ -10,11 +10,11 @@ target datalayout = "e-p:64:64:64-n32:64" define internal fastcc void @someFunction(%struct.this_structure_s.0.5* nocapture %scratch, i32 %stage, i32 %cbSize) nounwind { entry: - %0 = getelementptr inbounds %struct.this_structure_s.0.5* %scratch, i32 0, i32 4, i32 %stage - %1 = load i8** %0, align 4 - %2 = getelementptr inbounds %struct.this_structure_s.0.5* %scratch, i32 0, i32 5, i32 %stage - %3 = load i8** %2, align 4 - %4 = getelementptr inbounds %struct.this_structure_s.0.5* %scratch, i32 0, i32 2, i32 0, i32 0 + %0 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 4, i32 %stage + %1 = load i8*, i8** %0, align 4 + %2 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 5, i32 %stage + %3 = load i8*, i8** %2, align 4 + %4 = getelementptr inbounds %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 2, i32 0, i32 0 %tmp11 = shl i32 %stage, 1 %tmp1325 = or i32 %tmp11, 1 br label %__label_D_1608 @@ -22,18 +22,18 @@ entry: __label_D_1608: ; preds = %__label_D_1608, %entry %i.12 = phi i32 [ 0, %entry ], [ %10, %__label_D_1608 ] %tmp = shl i32 %i.12, 2 - %lvar_g.13 = getelementptr i32* %4, i32 %tmp + %lvar_g.13 = getelementptr i32, i32* %4, i32 %tmp %tmp626 = or i32 %tmp, 1 - %scevgep = getelementptr i32* %4, i32 %tmp626 + %scevgep = getelementptr i32, i32* %4, i32 %tmp626 %tmp727 = or i32 %tmp, 2 - %scevgep8 = getelementptr i32* %4, i32 %tmp727 + %scevgep8 = getelementptr i32, i32* %4, i32 %tmp727 %tmp928 = or i32 %tmp, 3 - %scevgep10 = getelementptr i32* %4, i32 %tmp928 - %scevgep12 = getelementptr %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp11, i32 %i.12 - %scevgep14 = getelementptr %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp1325, i32 %i.12 - %5 = load i8* %scevgep12, align 1 + %scevgep10 = getelementptr i32, i32* %4, i32 %tmp928 + %scevgep12 = getelementptr %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp11, i32 %i.12 + %scevgep14 = getelementptr %struct.this_structure_s.0.5, %struct.this_structure_s.0.5* %scratch, i32 0, i32 9, i32 %tmp1325, i32 %i.12 + %5 = load i8, i8* %scevgep12, align 1 %6 = sext i8 %5 to i32 - %7 = load i8* %scevgep14, align 1 + %7 = load i8, i8* %scevgep14, align 1 %8 = sext i8 %7 to i32 store i32 0, i32* %lvar_g.13, align 4 store i32 %8, i32* %scevgep, align 4 diff --git a/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll b/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll index ea1d65b..80095c3 100644 --- a/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll +++ b/test/Transforms/LoopStrengthReduce/2012-07-13-ExpandUDiv.ll @@ -17,12 +17,12 @@ target triple = "x86_64-apple-darwin" define i32 @main() nounwind uwtable ssp { entry: %l_2 = alloca [1 x i32], align 4 - %arrayidx = getelementptr inbounds [1 x i32]* %l_2, i64 0, i64 0 + %arrayidx = getelementptr inbounds [1 x i32], [1 x i32]* %l_2, i64 0, i64 0 store i32 0, i32* %arrayidx, align 4 - %tmp = load i32* @g_3, align 4 + %tmp = load i32, i32* @g_3, align 4 %idxprom = sext i32 %tmp to i64 - %arrayidx1 = getelementptr inbounds [1 x i32]* %l_2, i64 0, i64 %idxprom - %tmp1 = load i32* %arrayidx1, align 4 + %arrayidx1 = getelementptr inbounds [1 x i32], [1 x i32]* %l_2, i64 0, i64 %idxprom + %tmp1 = load i32, i32* %arrayidx1, align 4 %conv.i.i = and i32 %tmp1, 65535 %tobool.i.i.i = icmp ne i32 %tmp, 0 br label %codeRepl diff --git a/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll b/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll index 9524be3..dba97f5 100644 --- a/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll +++ b/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll @@ -1,5 +1,4 @@ -; RUN: opt -loop-reduce -disable-output -debug-only=loop-reduce < %s 2> %t -; RUN: FileCheck %s < %t +; RUN: opt -loop-reduce -disable-output -debug-only=loop-reduce < %s 2>&1 | FileCheck %s ; REQUIRES: asserts ; ; PR13361: LSR + SCEV "hangs" on reasonably sized test with sequence of loops @@ -18,6 +17,10 @@ ; CHECK-NOT:reg ; CHECK: Filtering for use +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + %struct.snork = type { %struct.fuga, i32, i32, i32, i32, i32, i32 } %struct.fuga = type { %struct.gork, i64 } %struct.gork = type { i8*, i32, i32, %struct.noot* } @@ -44,18 +47,18 @@ bb: br i1 %tmp4, label %bb6, label %bb5 bb5: ; preds = %bb - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2021) nounwind - tail call void (...)* @snork(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 3, i64 1), i32 -2146631418) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2021) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 1), i32 -2146631418) nounwind unreachable bb6: ; preds = %bb - tail call void @zot(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 5, i64 0), i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 3, i64 1), i64 undef, i32 1, i1 false) nounwind - %tmp7 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 5, i64 undef + tail call void @zot(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 0), i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 1), i64 undef, i32 1, i1 false) nounwind + %tmp7 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 undef store i8 0, i8* %tmp7, align 1 %tmp8 = add nsw i32 0, 1 %tmp9 = sext i32 %tmp8 to i64 %tmp10 = add i64 %tmp9, 1 - %tmp11 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 %tmp10 + %tmp11 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 %tmp10 %tmp12 = sub i64 2047, %tmp9 %tmp13 = icmp eq i32 undef, 1 br i1 %tmp13, label %bb14, label %bb15 @@ -76,8 +79,8 @@ bb17: ; preds = %bb26, %bb15 br i1 %tmp21, label %bb22, label %bb32 bb22: ; preds = %bb17 - %tmp23 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 0 - %tmp24 = load i8* %tmp23, align 1 + %tmp23 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 0 + %tmp24 = load i8, i8* %tmp23, align 1 %tmp25 = icmp eq i8 %tmp24, 58 br i1 %tmp25, label %bb30, label %bb26 @@ -92,18 +95,18 @@ bb30: ; preds = %bb22 br i1 %tmp31, label %bb33, label %bb32 bb32: ; preds = %bb30, %bb26, %bb17 - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2038) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2038) nounwind tail call void (...)* @snork(i8* %tmp11, i32 -2146631418) nounwind unreachable bb33: ; preds = %bb30 - tail call void @zot(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp11, i64 undef, i32 1, i1 false) nounwind - %tmp34 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 5, i64 undef + tail call void @zot(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp11, i64 undef, i32 1, i1 false) nounwind + %tmp34 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 undef store i8 0, i8* %tmp34, align 1 %tmp35 = add nsw i32 %tmp19, 1 %tmp36 = sext i32 %tmp35 to i64 %tmp37 = add i64 %tmp36, %tmp10 - %tmp38 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 %tmp37 + %tmp38 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 %tmp37 %tmp39 = sub i64 %tmp12, %tmp36 br i1 false, label %bb40, label %bb41 @@ -123,7 +126,7 @@ bb43: ; preds = %bb52, %bb41 bb48: ; preds = %bb43 %tmp49 = add i64 %tmp44, %tmp37 - %tmp50 = load i8* undef, align 1 + %tmp50 = load i8, i8* undef, align 1 %tmp51 = icmp eq i8 %tmp50, 58 br i1 %tmp51, label %bb55, label %bb52 @@ -138,14 +141,14 @@ bb55: ; preds = %bb48 br i1 %tmp57, label %bb59, label %bb58 bb58: ; preds = %bb55, %bb52, %bb43 - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2055) nounwind + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2055) nounwind tail call void (...)* @snork(i8* %tmp38, i32 -2146631418) nounwind br label %bb247 bb59: ; preds = %bb55 %tmp60 = sext i32 %tmp45 to i64 - tail call void @zot(i8* getelementptr inbounds (%struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp38, i64 %tmp60, i32 1, i1 false) nounwind - %tmp61 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 5, i64 %tmp60 + tail call void @zot(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 0), i8* %tmp38, i64 %tmp60, i32 1, i1 false) nounwind + %tmp61 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 5, i64 %tmp60 store i8 0, i8* %tmp61, align 1 %tmp62 = add nsw i32 %tmp45, 1 %tmp63 = sext i32 %tmp62 to i64 @@ -165,12 +168,12 @@ bb68: ; preds = %bb59 ] bb69: ; preds = %bb68 - tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8]* @global1, i64 0, i64 0), i32 2071) nounwind - %tmp70 = load i32* getelementptr inbounds (%struct.snork* @global, i64 0, i32 2), align 4 + tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2071) nounwind + %tmp70 = load i32, i32* getelementptr inbounds (%struct.snork, %struct.snork* @global, i64 0, i32 2), align 4 unreachable bb71: ; preds = %bb68 - %tmp72 = load i32* getelementptr inbounds (%struct.snork* @global, i64 0, i32 4), align 4 + %tmp72 = load i32, i32* getelementptr inbounds (%struct.snork, %struct.snork* @global, i64 0, i32 4), align 4 %tmp73 = icmp eq i32 undef, 0 br i1 %tmp73, label %bb247, label %bb74 @@ -461,8 +464,8 @@ bb221: ; preds = %bb230, %bb219 bb226: ; preds = %bb221 %tmp227 = add i64 %tmp222, %tmp216 - %tmp228 = getelementptr inbounds %struct.jim* @global3, i64 0, i32 3, i64 %tmp227 - %tmp229 = load i8* %tmp228, align 1 + %tmp228 = getelementptr inbounds %struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 %tmp227 + %tmp229 = load i8, i8* %tmp228, align 1 br i1 false, label %bb233, label %bb230 bb230: ; preds = %bb226 diff --git a/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll b/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll index 79dbf0d..dcd0681 100644 --- a/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll +++ b/test/Transforms/LoopStrengthReduce/2013-01-14-ReuseCast.ll @@ -72,8 +72,8 @@ bb61: ; preds = %bb63, %bb58 br i1 %tmp62, label %_ZNK4llvm9StringRef4findEcm.exit._crit_edge, label %bb63 bb63: ; preds = %bb61 - %tmp64 = getelementptr inbounds i8* %tmp3, i64 %i.0.i - %tmp65 = load i8* %tmp64, align 1 + %tmp64 = getelementptr inbounds i8, i8* %tmp3, i64 %i.0.i + %tmp65 = load i8, i8* %tmp64, align 1 %tmp67 = add i64 %i.0.i, 1 br i1 undef, label %_ZNK4llvm9StringRef4findEcm.exit.loopexit, label %bb61 diff --git a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll index 9a175ad..2120b2a 100644 --- a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll +++ b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memcpy.ll @@ -19,9 +19,9 @@ while.body: ; preds = %while.body, %entry %len.06 = phi i64 [ 1288, %entry ], [ %sub, %while.body ] %pDst.05 = phi i64* [ inttoptr (i64 6442450944 to i64*), %entry ], [ %incdec.ptr1, %while.body ] %pSrc.04 = phi i64* [ inttoptr (i64 4294967296 to i64*), %entry ], [ %incdec.ptr, %while.body ] - %incdec.ptr = getelementptr inbounds i64* %pSrc.04, i64 1 - %tmp = load volatile i64* %pSrc.04, align 8 - %incdec.ptr1 = getelementptr inbounds i64* %pDst.05, i64 1 + %incdec.ptr = getelementptr inbounds i64, i64* %pSrc.04, i64 1 + %tmp = load volatile i64, i64* %pSrc.04, align 8 + %incdec.ptr1 = getelementptr inbounds i64, i64* %pDst.05, i64 1 store volatile i64 %tmp, i64* %pDst.05, align 8 %sub = add i64 %len.06, -8 %cmp = icmp sgt i64 %sub, -1 diff --git a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll index 48b7094..e84f675 100644 --- a/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll +++ b/test/Transforms/LoopStrengthReduce/AArch64/lsr-memset.ll @@ -38,7 +38,7 @@ land.rhs: ; preds = %while.cond br i1 %cmp5, label %if.end9, label %while.body while.body: ; preds = %land.rhs - %incdec.ptr = getelementptr inbounds i8* %ptr.0, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %ptr.0, i64 1 store i8 %conv, i8* %ptr.0, align 1, !tbaa !0 %dec = add i64 %len.addr.0, -1 br label %while.cond @@ -67,7 +67,7 @@ if.end9: ; preds = %land.rhs while.body18: ; preds = %if.end9, %while.body18 %wideptr.038 = phi i64* [ %incdec.ptr19, %while.body18 ], [ %9, %if.end9 ] %len.addr.137 = phi i64 [ %sub, %while.body18 ], [ %len.addr.0, %if.end9 ] - %incdec.ptr19 = getelementptr inbounds i64* %wideptr.038, i64 1 + %incdec.ptr19 = getelementptr inbounds i64, i64* %wideptr.038, i64 1 store i64 %ins, i64* %wideptr.038, align 8, !tbaa !2 %sub = add i64 %len.addr.137, -8 %cmp16 = icmp ugt i64 %sub, 7 @@ -87,7 +87,7 @@ while.body29: ; preds = %while.body29, %whil %len.addr.235 = phi i64 [ %len.addr.1.lcssa49, %while.body29.lr.ph ], [ %dec26, %while.body29 ] %ptr.134 = phi i8* [ %10, %while.body29.lr.ph ], [ %incdec.ptr31, %while.body29 ] %dec26 = add i64 %len.addr.235, -1 - %incdec.ptr31 = getelementptr inbounds i8* %ptr.134, i64 1 + %incdec.ptr31 = getelementptr inbounds i8, i8* %ptr.134, i64 1 store i8 %conv, i8* %ptr.134, align 1, !tbaa !0 %cmp27 = icmp eq i64 %dec26, 0 br i1 %cmp27, label %done, label %while.body29 diff --git a/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll b/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll index 217896e..c877ace 100644 --- a/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll +++ b/test/Transforms/LoopStrengthReduce/AArch64/req-regs.ll @@ -11,7 +11,7 @@ target triple = "arm64-apple-ios" define void @do_integer_add(i64 %iterations, i8* nocapture readonly %cookie) { entry: %N = bitcast i8* %cookie to i32* - %0 = load i32* %N, align 4 + %0 = load i32, i32* %N, align 4 %add = add nsw i32 %0, 57 %cmp56 = icmp eq i64 %iterations, 0 br i1 %cmp56, label %while.end, label %for.cond.preheader.preheader diff --git a/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll b/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll index 1d56dde..56ff69c 100644 --- a/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll +++ b/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll @@ -50,7 +50,7 @@ declare %s* @getstruct() nounwind ; CHECK: ldr{{.*}}lsl #2 define i32 @main() nounwind ssp { entry: - %v0 = load i32* @ncol, align 4 + %v0 = load i32, i32* @ncol, align 4 %v1 = tail call i32* @getptr() nounwind %cmp10.i = icmp eq i32 %v0, 0 br label %while.cond.outer @@ -64,12 +64,12 @@ while.cond: br label %while.body while.body: - %v3 = load i32* @ncol, align 4 + %v3 = load i32, i32* @ncol, align 4 br label %end_of_chain end_of_chain: - %state.i = getelementptr inbounds %s* %call18, i32 0, i32 0 - %v4 = load i32** %state.i, align 4 + %state.i = getelementptr inbounds %s, %s* %call18, i32 0, i32 0 + %v4 = load i32*, i32** %state.i, align 4 br label %while.cond.i.i while.cond.i.i: @@ -79,10 +79,10 @@ while.cond.i.i: br i1 %tobool.i.i, label %where.exit, label %land.rhs.i.i land.rhs.i.i: - %arrayidx.i.i = getelementptr inbounds i32* %v4, i32 %dec.i.i - %v5 = load i32* %arrayidx.i.i, align 4 - %arrayidx1.i.i = getelementptr inbounds i32* %v1, i32 %dec.i.i - %v6 = load i32* %arrayidx1.i.i, align 4 + %arrayidx.i.i = getelementptr inbounds i32, i32* %v4, i32 %dec.i.i + %v5 = load i32, i32* %arrayidx.i.i, align 4 + %arrayidx1.i.i = getelementptr inbounds i32, i32* %v1, i32 %dec.i.i + %v6 = load i32, i32* %arrayidx1.i.i, align 4 %cmp.i.i = icmp eq i32 %v5, %v6 br i1 %cmp.i.i, label %while.cond.i.i, label %equal_data.exit.i diff --git a/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll b/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll index 26b2940..2ad6c2e 100644 --- a/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll +++ b/test/Transforms/LoopStrengthReduce/ARM/ivchain-ARM.ll @@ -18,18 +18,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop exit: @@ -52,18 +52,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x store i32 %s4, i32* %iv %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop @@ -103,26 +103,26 @@ for.body: ; preds = %for.body.lr.ph, %fo %i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %res.addr.09 = phi i32* [ %res, %for.body.lr.ph ], [ %add.ptr7, %for.body ] %0 = bitcast i8* %main.addr.011 to i32* - %1 = load i32* %0, align 4 - %add.ptr = getelementptr inbounds i8* %main.addr.011, i32 %main_stride + %1 = load i32, i32* %0, align 4 + %add.ptr = getelementptr inbounds i8, i8* %main.addr.011, i32 %main_stride %2 = bitcast i8* %add.ptr to i32* - %3 = load i32* %2, align 4 - %add.ptr1 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr.sum + %3 = load i32, i32* %2, align 4 + %add.ptr1 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr.sum %4 = bitcast i8* %add.ptr1 to i32* - %5 = load i32* %4, align 4 - %add.ptr2 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr1.sum + %5 = load i32, i32* %4, align 4 + %add.ptr2 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr1.sum %6 = bitcast i8* %add.ptr2 to i32* - %7 = load i32* %6, align 4 - %add.ptr3 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr4.sum + %7 = load i32, i32* %6, align 4 + %add.ptr3 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr4.sum %8 = bitcast i8* %add.ptr3 to i32* - %9 = load i32* %8, align 4 + %9 = load i32, i32* %8, align 4 %add = add i32 %3, %1 %add4 = add i32 %add, %5 %add5 = add i32 %add4, %7 %add6 = add i32 %add5, %9 store i32 %add6, i32* %res.addr.09, align 4 - %add.ptr6 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr3.sum - %add.ptr7 = getelementptr inbounds i32* %res.addr.09, i32 %y + %add.ptr6 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr3.sum + %add.ptr7 = getelementptr inbounds i32, i32* %res.addr.09, i32 %y %inc = add i32 %i.010, 1 %cmp = icmp eq i32 %inc, %z br i1 %cmp, label %for.end, label %for.body @@ -146,48 +146,48 @@ entry: for.body: ; preds = %for.body, %entry %i.07 = phi i32 [ 0, %entry ], [ %inc.3, %for.body ] - %arrayidx = getelementptr inbounds i8* %a, i32 %i.07 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.07 + %0 = load i8, i8* %arrayidx, align 1 %conv5 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %b, i32 %i.07 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.07 + %1 = load i8, i8* %arrayidx1, align 1 %conv26 = zext i8 %1 to i32 %add = add nsw i32 %conv26, %conv5 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8* %c, i32 %i.07 + %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.07 store i8 %conv3, i8* %arrayidx4, align 1 %inc1 = or i32 %i.07, 1 - %arrayidx.1 = getelementptr inbounds i8* %a, i32 %inc1 - %2 = load i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %inc1 + %2 = load i8, i8* %arrayidx.1, align 1 %conv5.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8* %b, i32 %inc1 - %3 = load i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %inc1 + %3 = load i8, i8* %arrayidx1.1, align 1 %conv26.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv26.1, %conv5.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8* %c, i32 %inc1 + %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %inc1 store i8 %conv3.1, i8* %arrayidx4.1, align 1 %inc.12 = or i32 %i.07, 2 - %arrayidx.2 = getelementptr inbounds i8* %a, i32 %inc.12 - %4 = load i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %inc.12 + %4 = load i8, i8* %arrayidx.2, align 1 %conv5.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8* %b, i32 %inc.12 - %5 = load i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %inc.12 + %5 = load i8, i8* %arrayidx1.2, align 1 %conv26.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv26.2, %conv5.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8* %c, i32 %inc.12 + %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %inc.12 store i8 %conv3.2, i8* %arrayidx4.2, align 1 %inc.23 = or i32 %i.07, 3 - %arrayidx.3 = getelementptr inbounds i8* %a, i32 %inc.23 - %6 = load i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %inc.23 + %6 = load i8, i8* %arrayidx.3, align 1 %conv5.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8* %b, i32 %inc.23 - %7 = load i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %inc.23 + %7 = load i8, i8* %arrayidx1.3, align 1 %conv26.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv26.3, %conv5.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8* %c, i32 %inc.23 + %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %inc.23 store i8 %conv3.3, i8* %arrayidx4.3, align 1 %inc.3 = add nsw i32 %i.07, 4 %exitcond.3 = icmp eq i32 %inc.3, 400 @@ -240,31 +240,31 @@ define hidden void @testNeon(i8* %ref_data, i32 %ref_stride, i32 %limit, <16 x i %result.03 = phi <16 x i8> [ zeroinitializer, %.lr.ph ], [ %41, %11 ] %.012 = phi <16 x i8>* [ %data, %.lr.ph ], [ %43, %11 ] %12 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %.05, i32 1) nounwind - %13 = getelementptr inbounds i8* %.05, i32 %ref_stride + %13 = getelementptr inbounds i8, i8* %.05, i32 %ref_stride %14 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %13, i32 1) nounwind %15 = shufflevector <1 x i64> %12, <1 x i64> %14, <2 x i32> <i32 0, i32 1> %16 = bitcast <2 x i64> %15 to <16 x i8> - %17 = getelementptr inbounds <16 x i8>* %.012, i32 1 + %17 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 1 store <16 x i8> %16, <16 x i8>* %.012, align 4 - %18 = getelementptr inbounds i8* %.05, i32 %2 + %18 = getelementptr inbounds i8, i8* %.05, i32 %2 %19 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %18, i32 1) nounwind - %20 = getelementptr inbounds i8* %.05, i32 %3 + %20 = getelementptr inbounds i8, i8* %.05, i32 %3 %21 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %20, i32 1) nounwind %22 = shufflevector <1 x i64> %19, <1 x i64> %21, <2 x i32> <i32 0, i32 1> %23 = bitcast <2 x i64> %22 to <16 x i8> - %24 = getelementptr inbounds <16 x i8>* %.012, i32 2 + %24 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 2 store <16 x i8> %23, <16 x i8>* %17, align 4 - %25 = getelementptr inbounds i8* %.05, i32 %4 + %25 = getelementptr inbounds i8, i8* %.05, i32 %4 %26 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %25, i32 1) nounwind - %27 = getelementptr inbounds i8* %.05, i32 %5 + %27 = getelementptr inbounds i8, i8* %.05, i32 %5 %28 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %27, i32 1) nounwind %29 = shufflevector <1 x i64> %26, <1 x i64> %28, <2 x i32> <i32 0, i32 1> %30 = bitcast <2 x i64> %29 to <16 x i8> - %31 = getelementptr inbounds <16 x i8>* %.012, i32 3 + %31 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 3 store <16 x i8> %30, <16 x i8>* %24, align 4 - %32 = getelementptr inbounds i8* %.05, i32 %6 + %32 = getelementptr inbounds i8, i8* %.05, i32 %6 %33 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %32, i32 1) nounwind - %34 = getelementptr inbounds i8* %.05, i32 %7 + %34 = getelementptr inbounds i8, i8* %.05, i32 %7 %35 = tail call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %34, i32 1) nounwind %36 = shufflevector <1 x i64> %33, <1 x i64> %35, <2 x i32> <i32 0, i32 1> %37 = bitcast <2 x i64> %36 to <16 x i8> @@ -273,14 +273,14 @@ define hidden void @testNeon(i8* %ref_data, i32 %ref_stride, i32 %limit, <16 x i %39 = add <16 x i8> %38, %30 %40 = add <16 x i8> %39, %37 %41 = add <16 x i8> %result.03, %40 - %42 = getelementptr i8* %.05, i32 %9 - %43 = getelementptr inbounds <16 x i8>* %.012, i32 -64 + %42 = getelementptr i8, i8* %.05, i32 %9 + %43 = getelementptr inbounds <16 x i8>, <16 x i8>* %.012, i32 -64 %44 = add nsw i32 %counter.04, 1 %exitcond = icmp eq i32 %44, %limit br i1 %exitcond, label %._crit_edge, label %11 ._crit_edge: ; preds = %11 - %scevgep = getelementptr <16 x i8>* %data, i32 %10 + %scevgep = getelementptr <16 x i8>, <16 x i8>* %data, i32 %10 br label %45 ; <label>:45 ; preds = %._crit_edge, %0 @@ -327,20 +327,20 @@ entry: for.body: ; preds = %for.body, %entry %i.0110 = phi i32 [ 0, %entry ], [ %inc, %for.body ] %src.addr = phi i8* [ %src, %entry ], [ %add.ptr45, %for.body ] - %add.ptr = getelementptr inbounds i8* %src.addr, i32 %idx.neg + %add.ptr = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg %vld1 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr, i32 1) - %add.ptr3 = getelementptr inbounds i8* %src.addr, i32 %idx.neg2 + %add.ptr3 = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg2 %vld2 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr3, i32 1) - %add.ptr7 = getelementptr inbounds i8* %src.addr, i32 %idx.neg6 + %add.ptr7 = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg6 %vld3 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr7, i32 1) - %add.ptr11 = getelementptr inbounds i8* %src.addr, i32 %idx.neg10 + %add.ptr11 = getelementptr inbounds i8, i8* %src.addr, i32 %idx.neg10 %vld4 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr11, i32 1) %vld5 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %src.addr, i32 1) - %add.ptr17 = getelementptr inbounds i8* %src.addr, i32 %stride + %add.ptr17 = getelementptr inbounds i8, i8* %src.addr, i32 %stride %vld6 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr17, i32 1) - %add.ptr20 = getelementptr inbounds i8* %src.addr, i32 %mul5 + %add.ptr20 = getelementptr inbounds i8, i8* %src.addr, i32 %mul5 %vld7 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr20, i32 1) - %add.ptr23 = getelementptr inbounds i8* %src.addr, i32 %mul1 + %add.ptr23 = getelementptr inbounds i8, i8* %src.addr, i32 %mul1 %vld8 = tail call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %add.ptr23, i32 1) %vadd1 = tail call <8 x i8> @llvm.arm.neon.vhaddu.v8i8(<8 x i8> %vld1, <8 x i8> %vld2) nounwind %vadd2 = tail call <8 x i8> @llvm.arm.neon.vhaddu.v8i8(<8 x i8> %vld2, <8 x i8> %vld3) nounwind @@ -355,7 +355,7 @@ for.body: ; preds = %for.body, %entry tail call void @llvm.arm.neon.vst1.v8i8(i8* %add.ptr17, <8 x i8> %vadd5, i32 1) tail call void @llvm.arm.neon.vst1.v8i8(i8* %add.ptr20, <8 x i8> %vadd6, i32 1) %inc = add nsw i32 %i.0110, 1 - %add.ptr45 = getelementptr inbounds i8* %src.addr, i32 8 + %add.ptr45 = getelementptr inbounds i8, i8* %src.addr, i32 8 %exitcond = icmp eq i32 %inc, 4 br i1 %exitcond, label %for.end, label %for.body diff --git a/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll b/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll index 9a7f486..ba03597 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -loop-reduce -S -mtriple=x86_64-unknown-unknown | grep "phi double" | count 1 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @foobar(i32 %n) nounwind { entry: icmp eq i32 %n, 0 ; <i1>:0 [#uses=2] diff --git a/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll b/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll index 2fe62e3..0fc928c 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll @@ -4,6 +4,10 @@ ; nonzero initial value. ; rdar://9786536 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; First, make sure LSR doesn't crash on an empty IVUsers list. ; CHECK-LABEL: @dummyIV( ; CHECK-NOT: phi diff --git a/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll b/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll index 001a1d6..862fff2 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll @@ -29,34 +29,34 @@ for.body: ; preds = %entry, %for.body %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body ], [ 0, %entry ] %dp.036 = phi i32* [ %add.ptr, %for.body ], [ %destrow, %entry ] %p.035 = phi float* [ %incdec.ptr4, %for.body ], [ %srcrow, %entry ] - %incdec.ptr = getelementptr inbounds float* %p.035, i64 1 - %0 = load float* %incdec.ptr, align 4 - %incdec.ptr2 = getelementptr inbounds float* %p.035, i64 2 - %1 = load float* %incdec.ptr2, align 4 - %incdec.ptr3 = getelementptr inbounds float* %p.035, i64 3 - %2 = load float* %incdec.ptr3, align 4 - %incdec.ptr4 = getelementptr inbounds float* %p.035, i64 4 - %3 = load float* %incdec.ptr4, align 4 - %4 = load i32* %dp.036, align 4 + %incdec.ptr = getelementptr inbounds float, float* %p.035, i64 1 + %0 = load float, float* %incdec.ptr, align 4 + %incdec.ptr2 = getelementptr inbounds float, float* %p.035, i64 2 + %1 = load float, float* %incdec.ptr2, align 4 + %incdec.ptr3 = getelementptr inbounds float, float* %p.035, i64 3 + %2 = load float, float* %incdec.ptr3, align 4 + %incdec.ptr4 = getelementptr inbounds float, float* %p.035, i64 4 + %3 = load float, float* %incdec.ptr4, align 4 + %4 = load i32, i32* %dp.036, align 4 %conv5 = fptoui float %0 to i32 %or = or i32 %4, %conv5 - %arrayidx6 = getelementptr inbounds i32* %dp.036, i64 1 - %5 = load i32* %arrayidx6, align 4 + %arrayidx6 = getelementptr inbounds i32, i32* %dp.036, i64 1 + %5 = load i32, i32* %arrayidx6, align 4 %conv7 = fptoui float %1 to i32 %or8 = or i32 %5, %conv7 - %arrayidx9 = getelementptr inbounds i32* %dp.036, i64 2 - %6 = load i32* %arrayidx9, align 4 + %arrayidx9 = getelementptr inbounds i32, i32* %dp.036, i64 2 + %6 = load i32, i32* %arrayidx9, align 4 %conv10 = fptoui float %2 to i32 %or11 = or i32 %6, %conv10 - %arrayidx12 = getelementptr inbounds i32* %dp.036, i64 3 - %7 = load i32* %arrayidx12, align 4 + %arrayidx12 = getelementptr inbounds i32, i32* %dp.036, i64 3 + %7 = load i32, i32* %arrayidx12, align 4 %conv13 = fptoui float %3 to i32 %or14 = or i32 %7, %conv13 store i32 %or, i32* %dp.036, align 4 store i32 %or8, i32* %arrayidx6, align 4 store i32 %or11, i32* %arrayidx9, align 4 store i32 %or14, i32* %arrayidx12, align 4 - %add.ptr = getelementptr inbounds i32* %dp.036, i64 4 + %add.ptr = getelementptr inbounds i32, i32* %dp.036, i64 4 %indvars.iv.next40 = add i64 %indvars.iv39, 4 %dummycnt = add i64 %dummyiv, 1 %cmp = icmp ult i64 %indvars.iv.next40, %count @@ -76,14 +76,14 @@ for.body23: ; preds = %for.body23, %for.bo %indvars.iv = phi i64 [ 0, %for.body23.lr.ph ], [ %indvars.iv.next, %for.body23 ] %dp.132 = phi i32* [ %add.ptr, %for.body23.lr.ph ], [ %incdec.ptr28, %for.body23 ] %p.131 = phi float* [ %incdec.ptr4, %for.body23.lr.ph ], [ %incdec.ptr24, %for.body23 ] - %incdec.ptr24 = getelementptr inbounds float* %p.131, i64 1 - %9 = load float* %incdec.ptr24, align 4 - %10 = load i32* %dp.132, align 4 + %incdec.ptr24 = getelementptr inbounds float, float* %p.131, i64 1 + %9 = load float, float* %incdec.ptr24, align 4 + %10 = load i32, i32* %dp.132, align 4 %conv25 = fptoui float %9 to i32 %or26 = or i32 %10, %conv25 store i32 %or26, i32* %dp.132, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 - %incdec.ptr28 = getelementptr inbounds i32* %dp.132, i64 1 + %incdec.ptr28 = getelementptr inbounds i32, i32* %dp.132, i64 1 %exitcond = icmp eq i64 %indvars.iv.next, %8 br i1 %exitcond, label %for.end29, label %for.body23 diff --git a/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll b/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll index c3b8b89..184e300 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll @@ -27,14 +27,14 @@ while.body.i: ; preds = %cond.true29.i, %whi for.body.i: ; preds = %for.body.i, %while.body.i %indvars.iv.i = phi i64 [ 0, %while.body.i ], [ %indvars.iv.next.i, %for.body.i ] %add.ptr.sum = add i64 %add.ptr.sum.i, %indvars.iv.i - %arrayidx22.i = getelementptr inbounds i8* %base, i64 %add.ptr.sum - %0 = load i8* %arrayidx22.i, align 1 + %arrayidx22.i = getelementptr inbounds i8, i8* %base, i64 %add.ptr.sum + %0 = load i8, i8* %arrayidx22.i, align 1 %indvars.iv.next.i = add i64 %indvars.iv.i, 1 %cmp = call i1 @check() nounwind br i1 %cmp, label %for.end.i, label %for.body.i for.end.i: ; preds = %for.body.i - %add.ptr.i144 = getelementptr inbounds i8* %base, i64 %add.ptr.sum.i + %add.ptr.i144 = getelementptr inbounds i8, i8* %base, i64 %add.ptr.sum.i %cmp2 = tail call i1 @foo(i8* %add.ptr.i144, i8* %add.ptr.i144, i8* undef) nounwind br i1 %cmp2, label %cond.true29.i, label %cond.false35.i @@ -68,19 +68,19 @@ entry: for.cond468: ; preds = %if.then477, %entry %indvars.iv1163 = phi i64 [ %indvars.iv.next1164, %if.then477 ], [ 1, %entry ] - %k.0.in = phi i32* [ %last, %if.then477 ], [ getelementptr inbounds ([5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 0, i32 2), %entry ] - %k.0 = load i32* %k.0.in, align 4 + %k.0.in = phi i32* [ %last, %if.then477 ], [ getelementptr inbounds ([5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771], [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 0, i32 2), %entry ] + %k.0 = load i32, i32* %k.0.in, align 4 %0 = trunc i64 %indvars.iv1163 to i32 %cmp469 = icmp slt i32 %0, %n br i1 %cmp469, label %for.body471, label %for.inc498 for.body471: ; preds = %for.cond468 - %first = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 1 - %1 = load i32* %first, align 4 + %first = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771], [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 1 + %1 = load i32, i32* %first, align 4 br i1 undef, label %if.then477, label %for.inc498 if.then477: ; preds = %for.body471 - %last = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 2 + %last = getelementptr inbounds [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771], [5000 x %struct.anon.7.91.199.307.415.475.559.643.751.835.943.1003.1111.1219.1351.1375.1399.1435.1471.1483.1519.1531.1651.1771]* @tags, i64 0, i64 %indvars.iv1163, i32 2 %indvars.iv.next1164 = add i64 %indvars.iv1163, 1 br label %for.cond468 @@ -118,14 +118,14 @@ for.body3.us.i: ; preds = %meshBB, %for.body3. %0 = add nsw i64 %indvars.iv.i.SV.phi, %indvars.iv8.i.SV.phi26 %1 = trunc i64 %0 to i32 %mul.i.us.i = mul nsw i32 0, %1 - %arrayidx5.us.i = getelementptr inbounds double* %u, i64 %indvars.iv.i.SV.phi - %2 = load double* %arrayidx5.us.i, align 8 + %arrayidx5.us.i = getelementptr inbounds double, double* %u, i64 %indvars.iv.i.SV.phi + %2 = load double, double* %arrayidx5.us.i, align 8 %indvars.iv.next.i = add i64 %indvars.iv.i.SV.phi, 1 br i1 undef, label %for.inc8.us.i, label %meshBB for.body3.lr.ph.us.i: ; preds = %meshBB1, %meshBB %indvars.iv8.i.SV.phi26 = phi i64 [ undef, %meshBB1 ], [ %indvars.iv8.i.SV.phi24, %meshBB ] - %arrayidx.us.i = getelementptr inbounds double* undef, i64 %indvars.iv8.i.SV.phi26 + %arrayidx.us.i = getelementptr inbounds double, double* undef, i64 %indvars.iv8.i.SV.phi26 %3 = add i64 %indvars.iv8.i.SV.phi26, 1 br label %for.body3.us.i diff --git a/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll b/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll index d8636a8..c1099b2 100644 --- a/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll +++ b/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll @@ -29,18 +29,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop exit: @@ -71,18 +71,18 @@ entry: loop: %iv = phi i32* [ %a, %entry ], [ %iv4, %loop ] %s = phi i32 [ 0, %entry ], [ %s4, %loop ] - %v = load i32* %iv - %iv1 = getelementptr inbounds i32* %iv, i32 %x - %v1 = load i32* %iv1 - %iv2 = getelementptr inbounds i32* %iv1, i32 %x - %v2 = load i32* %iv2 - %iv3 = getelementptr inbounds i32* %iv2, i32 %x - %v3 = load i32* %iv3 + %v = load i32, i32* %iv + %iv1 = getelementptr inbounds i32, i32* %iv, i32 %x + %v1 = load i32, i32* %iv1 + %iv2 = getelementptr inbounds i32, i32* %iv1, i32 %x + %v2 = load i32, i32* %iv2 + %iv3 = getelementptr inbounds i32, i32* %iv2, i32 %x + %v3 = load i32, i32* %iv3 %s1 = add i32 %s, %v %s2 = add i32 %s1, %v1 %s3 = add i32 %s2, %v2 %s4 = add i32 %s3, %v3 - %iv4 = getelementptr inbounds i32* %iv3, i32 %x + %iv4 = getelementptr inbounds i32, i32* %iv3, i32 %x store i32 %s4, i32* %iv %cmp = icmp eq i32* %iv4, %b br i1 %cmp, label %exit, label %loop @@ -126,26 +126,26 @@ for.body: ; preds = %for.body.lr.ph, %fo %i.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %res.addr.09 = phi i32* [ %res, %for.body.lr.ph ], [ %add.ptr7, %for.body ] %0 = bitcast i8* %main.addr.011 to i32* - %1 = load i32* %0, align 4 - %add.ptr = getelementptr inbounds i8* %main.addr.011, i32 %main_stride + %1 = load i32, i32* %0, align 4 + %add.ptr = getelementptr inbounds i8, i8* %main.addr.011, i32 %main_stride %2 = bitcast i8* %add.ptr to i32* - %3 = load i32* %2, align 4 - %add.ptr1 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr.sum + %3 = load i32, i32* %2, align 4 + %add.ptr1 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr.sum %4 = bitcast i8* %add.ptr1 to i32* - %5 = load i32* %4, align 4 - %add.ptr2 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr1.sum + %5 = load i32, i32* %4, align 4 + %add.ptr2 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr1.sum %6 = bitcast i8* %add.ptr2 to i32* - %7 = load i32* %6, align 4 - %add.ptr3 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr4.sum + %7 = load i32, i32* %6, align 4 + %add.ptr3 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr4.sum %8 = bitcast i8* %add.ptr3 to i32* - %9 = load i32* %8, align 4 + %9 = load i32, i32* %8, align 4 %add = add i32 %3, %1 %add4 = add i32 %add, %5 %add5 = add i32 %add4, %7 %add6 = add i32 %add5, %9 store i32 %add6, i32* %res.addr.09, align 4 - %add.ptr6 = getelementptr inbounds i8* %main.addr.011, i32 %add.ptr3.sum - %add.ptr7 = getelementptr inbounds i32* %res.addr.09, i32 %y + %add.ptr6 = getelementptr inbounds i8, i8* %main.addr.011, i32 %add.ptr3.sum + %add.ptr7 = getelementptr inbounds i32, i32* %res.addr.09, i32 %y %inc = add i32 %i.010, 1 %cmp = icmp eq i32 %inc, %z br i1 %cmp, label %for.end, label %for.body @@ -172,48 +172,48 @@ entry: for.body: ; preds = %for.body, %entry %i.07 = phi i32 [ 0, %entry ], [ %inc.3, %for.body ] - %arrayidx = getelementptr inbounds i8* %a, i32 %i.07 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.07 + %0 = load i8, i8* %arrayidx, align 1 %conv5 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %b, i32 %i.07 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.07 + %1 = load i8, i8* %arrayidx1, align 1 %conv26 = zext i8 %1 to i32 %add = add nsw i32 %conv26, %conv5 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8* %c, i32 %i.07 + %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.07 store i8 %conv3, i8* %arrayidx4, align 1 %inc1 = or i32 %i.07, 1 - %arrayidx.1 = getelementptr inbounds i8* %a, i32 %inc1 - %2 = load i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %inc1 + %2 = load i8, i8* %arrayidx.1, align 1 %conv5.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8* %b, i32 %inc1 - %3 = load i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %inc1 + %3 = load i8, i8* %arrayidx1.1, align 1 %conv26.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv26.1, %conv5.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8* %c, i32 %inc1 + %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %inc1 store i8 %conv3.1, i8* %arrayidx4.1, align 1 %inc.12 = or i32 %i.07, 2 - %arrayidx.2 = getelementptr inbounds i8* %a, i32 %inc.12 - %4 = load i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %inc.12 + %4 = load i8, i8* %arrayidx.2, align 1 %conv5.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8* %b, i32 %inc.12 - %5 = load i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %inc.12 + %5 = load i8, i8* %arrayidx1.2, align 1 %conv26.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv26.2, %conv5.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8* %c, i32 %inc.12 + %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %inc.12 store i8 %conv3.2, i8* %arrayidx4.2, align 1 %inc.23 = or i32 %i.07, 3 - %arrayidx.3 = getelementptr inbounds i8* %a, i32 %inc.23 - %6 = load i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %inc.23 + %6 = load i8, i8* %arrayidx.3, align 1 %conv5.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8* %b, i32 %inc.23 - %7 = load i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %inc.23 + %7 = load i8, i8* %arrayidx1.3, align 1 %conv26.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv26.3, %conv5.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8* %c, i32 %inc.23 + %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %inc.23 store i8 %conv3.3, i8* %arrayidx4.3, align 1 %inc.3 = add nsw i32 %i.07, 4 %exitcond.3 = icmp eq i32 %inc.3, 400 @@ -254,15 +254,15 @@ for.body: %i = phi i32 [ %inc4, %for.body ], [ 0, %entry ] store i32 %i, i32* %p, align 4 %inc1 = or i32 %i, 1 - %add.ptr.i1 = getelementptr inbounds i32* %p, i32 1 + %add.ptr.i1 = getelementptr inbounds i32, i32* %p, i32 1 store i32 %inc1, i32* %add.ptr.i1, align 4 %inc2 = add nsw i32 %i, 2 - %add.ptr.i2 = getelementptr inbounds i32* %p, i32 2 + %add.ptr.i2 = getelementptr inbounds i32, i32* %p, i32 2 store i32 %inc2, i32* %add.ptr.i2, align 4 %inc3 = add nsw i32 %i, 3 - %add.ptr.i3 = getelementptr inbounds i32* %p, i32 3 + %add.ptr.i3 = getelementptr inbounds i32, i32* %p, i32 3 store i32 %inc3, i32* %add.ptr.i3, align 4 - %p.next = getelementptr inbounds i32* %p, i32 4 + %p.next = getelementptr inbounds i32, i32* %p, i32 4 %inc4 = add nsw i32 %i, 4 %cmp = icmp slt i32 %inc4, %n br i1 %cmp, label %for.body, label %exit @@ -281,20 +281,20 @@ exit: ; X32: jne define void @testCmpZero(i8* %src, i8* %dst, i32 %srcidx, i32 %dstidx, i32 %len) nounwind ssp { entry: - %dest0 = getelementptr inbounds i8* %src, i32 %srcidx - %source0 = getelementptr inbounds i8* %dst, i32 %dstidx + %dest0 = getelementptr inbounds i8, i8* %src, i32 %srcidx + %source0 = getelementptr inbounds i8, i8* %dst, i32 %dstidx %add.ptr79.us.sum = add i32 %srcidx, %len - %lftr.limit = getelementptr i8* %src, i32 %add.ptr79.us.sum + %lftr.limit = getelementptr i8, i8* %src, i32 %add.ptr79.us.sum br label %for.body82.us for.body82.us: %dest = phi i8* [ %dest0, %entry ], [ %incdec.ptr91.us, %for.body82.us ] %source = phi i8* [ %source0, %entry ], [ %add.ptr83.us, %for.body82.us ] %0 = bitcast i8* %source to i32* - %1 = load i32* %0, align 4 + %1 = load i32, i32* %0, align 4 %trunc = trunc i32 %1 to i8 - %add.ptr83.us = getelementptr inbounds i8* %source, i32 4 - %incdec.ptr91.us = getelementptr inbounds i8* %dest, i32 1 + %add.ptr83.us = getelementptr inbounds i8, i8* %source, i32 4 + %incdec.ptr91.us = getelementptr inbounds i8, i8* %dest, i32 1 store i8 %trunc, i8* %dest, align 1 %exitcond = icmp eq i8* %incdec.ptr91.us, %lftr.limit br i1 %exitcond, label %return, label %for.body82.us diff --git a/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll b/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll index d8e0aa9..7925bf0 100644 --- a/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll +++ b/test/Transforms/LoopStrengthReduce/X86/ivchain-stress-X86.ll @@ -32,15 +32,15 @@ entry: for.body: ; preds = %entry, %for.body.3 %i.09 = phi i32 [ %add5.3, %for.body.3 ], [ 0, %entry ] - %arrayidx = getelementptr inbounds i8* %a, i32 %i.09 - %0 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds i8, i8* %a, i32 %i.09 + %0 = load i8, i8* %arrayidx, align 1 %conv6 = zext i8 %0 to i32 - %arrayidx1 = getelementptr inbounds i8* %b, i32 %i.09 - %1 = load i8* %arrayidx1, align 1 + %arrayidx1 = getelementptr inbounds i8, i8* %b, i32 %i.09 + %1 = load i8, i8* %arrayidx1, align 1 %conv27 = zext i8 %1 to i32 %add = add nsw i32 %conv27, %conv6 %conv3 = trunc i32 %add to i8 - %arrayidx4 = getelementptr inbounds i8* %c, i32 %i.09 + %arrayidx4 = getelementptr inbounds i8, i8* %c, i32 %i.09 store i8 %conv3, i8* %arrayidx4, align 1 %add5 = add i32 %i.09, %s %cmp = icmp ult i32 %add5, %len @@ -50,45 +50,45 @@ for.end: ; preds = %for.body, %for.body ret void for.body.1: ; preds = %for.body - %arrayidx.1 = getelementptr inbounds i8* %a, i32 %add5 - %2 = load i8* %arrayidx.1, align 1 + %arrayidx.1 = getelementptr inbounds i8, i8* %a, i32 %add5 + %2 = load i8, i8* %arrayidx.1, align 1 %conv6.1 = zext i8 %2 to i32 - %arrayidx1.1 = getelementptr inbounds i8* %b, i32 %add5 - %3 = load i8* %arrayidx1.1, align 1 + %arrayidx1.1 = getelementptr inbounds i8, i8* %b, i32 %add5 + %3 = load i8, i8* %arrayidx1.1, align 1 %conv27.1 = zext i8 %3 to i32 %add.1 = add nsw i32 %conv27.1, %conv6.1 %conv3.1 = trunc i32 %add.1 to i8 - %arrayidx4.1 = getelementptr inbounds i8* %c, i32 %add5 + %arrayidx4.1 = getelementptr inbounds i8, i8* %c, i32 %add5 store i8 %conv3.1, i8* %arrayidx4.1, align 1 %add5.1 = add i32 %add5, %s %cmp.1 = icmp ult i32 %add5.1, %len br i1 %cmp.1, label %for.body.2, label %for.end for.body.2: ; preds = %for.body.1 - %arrayidx.2 = getelementptr inbounds i8* %a, i32 %add5.1 - %4 = load i8* %arrayidx.2, align 1 + %arrayidx.2 = getelementptr inbounds i8, i8* %a, i32 %add5.1 + %4 = load i8, i8* %arrayidx.2, align 1 %conv6.2 = zext i8 %4 to i32 - %arrayidx1.2 = getelementptr inbounds i8* %b, i32 %add5.1 - %5 = load i8* %arrayidx1.2, align 1 + %arrayidx1.2 = getelementptr inbounds i8, i8* %b, i32 %add5.1 + %5 = load i8, i8* %arrayidx1.2, align 1 %conv27.2 = zext i8 %5 to i32 %add.2 = add nsw i32 %conv27.2, %conv6.2 %conv3.2 = trunc i32 %add.2 to i8 - %arrayidx4.2 = getelementptr inbounds i8* %c, i32 %add5.1 + %arrayidx4.2 = getelementptr inbounds i8, i8* %c, i32 %add5.1 store i8 %conv3.2, i8* %arrayidx4.2, align 1 %add5.2 = add i32 %add5.1, %s %cmp.2 = icmp ult i32 %add5.2, %len br i1 %cmp.2, label %for.body.3, label %for.end for.body.3: ; preds = %for.body.2 - %arrayidx.3 = getelementptr inbounds i8* %a, i32 %add5.2 - %6 = load i8* %arrayidx.3, align 1 + %arrayidx.3 = getelementptr inbounds i8, i8* %a, i32 %add5.2 + %6 = load i8, i8* %arrayidx.3, align 1 %conv6.3 = zext i8 %6 to i32 - %arrayidx1.3 = getelementptr inbounds i8* %b, i32 %add5.2 - %7 = load i8* %arrayidx1.3, align 1 + %arrayidx1.3 = getelementptr inbounds i8, i8* %b, i32 %add5.2 + %7 = load i8, i8* %arrayidx1.3, align 1 %conv27.3 = zext i8 %7 to i32 %add.3 = add nsw i32 %conv27.3, %conv6.3 %conv3.3 = trunc i32 %add.3 to i8 - %arrayidx4.3 = getelementptr inbounds i8* %c, i32 %add5.2 + %arrayidx4.3 = getelementptr inbounds i8, i8* %c, i32 %add5.2 store i8 %conv3.3, i8* %arrayidx4.3, align 1 %add5.3 = add i32 %add5.2, %s %cmp.3 = icmp ult i32 %add5.3, %len diff --git a/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll b/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll index 5506994..a6613c5 100644 --- a/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll +++ b/test/Transforms/LoopStrengthReduce/X86/no_superflous_induction_vars.ll @@ -38,9 +38,9 @@ for.body14.lr.ph: vector.body: %index = phi i64 [ %index.next, %vector.body ], [ %0, %for.body14.lr.ph ] - %4 = getelementptr inbounds i8* %rowsptr, i64 %index + %4 = getelementptr inbounds i8, i8* %rowsptr, i64 %index %5 = bitcast i8* %4 to <4 x i8>* - %wide.load = load <4 x i8>* %5, align 1 + %wide.load = load <4 x i8>, <4 x i8>* %5, align 1 %index.next = add i64 %index, 8 %6 = icmp eq i64 %index.next, %end.idx.rnd.down br i1 %6, label %for.end24, label %vector.body diff --git a/test/Transforms/LoopStrengthReduce/X86/pr17473.ll b/test/Transforms/LoopStrengthReduce/X86/pr17473.ll index e7ebaa8..093cf65 100644 --- a/test/Transforms/LoopStrengthReduce/X86/pr17473.ll +++ b/test/Transforms/LoopStrengthReduce/X86/pr17473.ll @@ -25,9 +25,9 @@ target triple = "x86_64-apple-macosx10.9.0" define i32 @main() #0 { entry: store i8 0, i8* @h, align 1 - %0 = load i32* @j, align 4 + %0 = load i32, i32* @j, align 4 %tobool.i = icmp eq i32 %0, 0 - %1 = load i32* @d, align 4 + %1 = load i32, i32* @d, align 4 %cmp3 = icmp sgt i32 %1, -1 %.lobit = lshr i32 %1, 31 %.lobit.not = xor i32 %.lobit, 1 @@ -55,7 +55,7 @@ for.end: ; preds = %fn3.exit %conv7 = sext i8 %inc to i32 %add = add nsw i32 %conv7, %conv store i32 %add, i32* @e, align 4 - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %add) #2 + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %add) #2 ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll b/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll index 6333291..5650f81 100644 --- a/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll +++ b/test/Transforms/LoopStrengthReduce/addrec-gep-address-space.ll @@ -1,15 +1,15 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s ; CHECK: bb1: -; CHECK: load double addrspace(1)* [[IV:%[^,]+]] +; CHECK: load double, double addrspace(1)* [[IV:%[^,]+]] ; CHECK: store double {{.*}}, double addrspace(1)* [[IV]] ; CHECK-NOT: cast ; Make sure the GEP has the right index type -; CHECK: getelementptr double addrspace(1)* [[IV]], i16 1 +; CHECK: getelementptr double, double addrspace(1)* [[IV]], i16 1 ; CHECK: br {{.*}} label %bb1 ; Make sure the GEP has the right index type -; CHECK: getelementptr double addrspace(1)* {{.*}}, i16 +; CHECK: getelementptr double, double addrspace(1)* {{.*}}, i16 ; This test tests several things. The load and store should use the @@ -36,11 +36,11 @@ bb1: ; preds = %bb2, %bb.nph %tmp3 = add i64 %j.01, %tmp1 ; <i64> [#uses=1] %tmp4 = add i64 %j.01, %tmp2 ; <i64> [#uses=1] %z0 = add i64 %tmp3, 5203 - %tmp5 = getelementptr double addrspace(1)* %p, i64 %z0 ; <double addrspace(1)*> [#uses=1] - %tmp6 = load double addrspace(1)* %tmp5, align 8 ; <double> [#uses=1] + %tmp5 = getelementptr double, double addrspace(1)* %p, i64 %z0 ; <double addrspace(1)*> [#uses=1] + %tmp6 = load double, double addrspace(1)* %tmp5, align 8 ; <double> [#uses=1] %tmp7 = fdiv double %tmp6, 2.100000e+00 ; <double> [#uses=1] %z1 = add i64 %tmp4, 5203 - %tmp8 = getelementptr double addrspace(1)* %p, i64 %z1 ; <double addrspace(1)*> [#uses=1] + %tmp8 = getelementptr double, double addrspace(1)* %p, i64 %z1 ; <double addrspace(1)*> [#uses=1] store double %tmp7, double addrspace(1)* %tmp8, align 8 %tmp9 = add i64 %j.01, 1 ; <i64> [#uses=2] br label %bb2 diff --git a/test/Transforms/LoopStrengthReduce/addrec-gep.ll b/test/Transforms/LoopStrengthReduce/addrec-gep.ll index 3e4e369..6919a33 100644 --- a/test/Transforms/LoopStrengthReduce/addrec-gep.ll +++ b/test/Transforms/LoopStrengthReduce/addrec-gep.ll @@ -1,8 +1,8 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s ; CHECK: bb1: -; CHECK: load double* [[IV:%[^,]+]] +; CHECK: load double, double* [[IV:%[^,]+]] ; CHECK: store double {{.*}}, double* [[IV]] -; CHECK: getelementptr double* +; CHECK: getelementptr double, double* ; CHECK-NOT: cast ; CHECK: br {{.*}} label %bb1 @@ -30,11 +30,11 @@ bb1: ; preds = %bb2, %bb.nph %tmp3 = add i64 %j.01, %tmp1 ; <i64> [#uses=1] %tmp4 = add i64 %j.01, %tmp2 ; <i64> [#uses=1] %z0 = add i64 %tmp3, 5203 - %tmp5 = getelementptr double* %p, i64 %z0 ; <double*> [#uses=1] - %tmp6 = load double* %tmp5, align 8 ; <double> [#uses=1] + %tmp5 = getelementptr double, double* %p, i64 %z0 ; <double*> [#uses=1] + %tmp6 = load double, double* %tmp5, align 8 ; <double> [#uses=1] %tmp7 = fdiv double %tmp6, 2.100000e+00 ; <double> [#uses=1] %z1 = add i64 %tmp4, 5203 - %tmp8 = getelementptr double* %p, i64 %z1 ; <double*> [#uses=1] + %tmp8 = getelementptr double, double* %p, i64 %z1 ; <double*> [#uses=1] store double %tmp7, double* %tmp8, align 8 %tmp9 = add i64 %j.01, 1 ; <i64> [#uses=2] br label %bb2 diff --git a/test/Transforms/LoopStrengthReduce/address-space-loop.ll b/test/Transforms/LoopStrengthReduce/address-space-loop.ll index 9c1b213..57ba665 100644 --- a/test/Transforms/LoopStrengthReduce/address-space-loop.ll +++ b/test/Transforms/LoopStrengthReduce/address-space-loop.ll @@ -27,7 +27,7 @@ bb3: ; preds = %bb2, %bb ; CHECK: bb10: ; CHECK-NEXT: %t7 = icmp eq i16 %t4, 0 ; Host %t2 computation outside the loop. -; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8 addrspace(1)* undef, i16 %t4 +; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* undef, i16 %t4 ; CHECK-NEXT: br label %bb14 bb10: ; preds = %bb9 %t7 = icmp eq i16 %t4, 0 ; <i1> [#uses=1] @@ -36,20 +36,20 @@ bb10: ; preds = %bb9 ; CHECK: bb14: ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[SCEVGEP]] -; CHECK-NEXT: %t6 = load float addrspace(1)* addrspace(1)* undef +; CHECK-NEXT: %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef ; Fold %t3's add within the address. -; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float addrspace(1)* %t6, i16 4 +; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float, float addrspace(1)* %t6, i16 4 ; CHECK-NEXT: [[SCEVGEP2:%[^ ]+]] = bitcast float addrspace(1)* [[SCEVGEP1]] to i8 addrspace(1)* ; Use the induction variable (%t4) to access the right element -; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 +; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[ADDRESS]] ; CHECK-NEXT: br label %bb14 bb14: ; preds = %bb14, %bb10 - %t2 = getelementptr inbounds i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] + %t2 = getelementptr inbounds i8, i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t2 - %t6 = load float addrspace(1)* addrspace(1)* undef + %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef %t8 = bitcast float addrspace(1)* %t6 to i8 addrspace(1)* ; <i8*> [#uses=1] - %t9 = getelementptr inbounds i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] + %t9 = getelementptr inbounds i8, i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t9 br label %bb14 } diff --git a/test/Transforms/LoopStrengthReduce/count-to-zero.ll b/test/Transforms/LoopStrengthReduce/count-to-zero.ll index 0e96f02..ca93e38 100644 --- a/test/Transforms/LoopStrengthReduce/count-to-zero.ll +++ b/test/Transforms/LoopStrengthReduce/count-to-zero.ll @@ -1,6 +1,9 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s ; rdar://7382068 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + define void @t(i32 %c) nounwind optsize { entry: br label %bb6 diff --git a/test/Transforms/LoopStrengthReduce/dominate-assert.ll b/test/Transforms/LoopStrengthReduce/dominate-assert.ll index 3ba93ff..bca234c 100644 --- a/test/Transforms/LoopStrengthReduce/dominate-assert.ll +++ b/test/Transforms/LoopStrengthReduce/dominate-assert.ll @@ -23,7 +23,7 @@ bb4: br label %bb9 bb5: %v5 = bitcast i8* %v3 to i32** - %add.ptr.i = getelementptr inbounds i32** %v5, i64 %v0 + %add.ptr.i = getelementptr inbounds i32*, i32** %v5, i64 %v0 br label %bb6 bb6: %v6 = phi i32** [ null, %bb2 ], [ %add.ptr.i, %bb5 ] @@ -49,7 +49,7 @@ bb2: invoke void @g() optsize to label %bb3 unwind label %bb6 bb3: - %arrayctor.next = getelementptr inbounds i8* %arrayctor.cur, i64 1 + %arrayctor.next = getelementptr inbounds i8, i8* %arrayctor.cur, i64 1 br label %bb2 bb4: ret void @@ -76,17 +76,17 @@ entry: while.cond: ; preds = %while.cond, %entry %c.0 = phi i16* [ undef, %entry ], [ %incdec.ptr, %while.cond ] - %incdec.ptr = getelementptr inbounds i16* %c.0, i64 1 + %incdec.ptr = getelementptr inbounds i16, i16* %c.0, i64 1 br i1 undef, label %while.cond1, label %while.cond while.cond1: ; preds = %while.cond1, %while.cond %c.1 = phi i16* [ %incdec.ptr5, %while.cond1 ], [ %c.0, %while.cond ] - %incdec.ptr5 = getelementptr inbounds i16* %c.1, i64 1 + %incdec.ptr5 = getelementptr inbounds i16, i16* %c.1, i64 1 br i1 undef, label %while.cond7, label %while.cond1 while.cond7: ; preds = %while.cond7, %while.cond1 %0 = phi i16* [ %incdec.ptr10, %while.cond7 ], [ %c.1, %while.cond1 ] - %incdec.ptr10 = getelementptr inbounds i16* %0, i64 1 + %incdec.ptr10 = getelementptr inbounds i16, i16* %0, i64 1 br i1 undef, label %while.cond12.preheader, label %while.cond7 while.cond12.preheader: ; preds = %while.cond7 @@ -104,7 +104,7 @@ while.body13.lr.ph: ; preds = %while.cond12.outer. br label %while.body13 if.else: ; preds = %while.body13 - %incdec.ptr15 = getelementptr inbounds i16* %1, i64 1 + %incdec.ptr15 = getelementptr inbounds i16, i16* %1, i64 1 %cmp = icmp eq i16* %incdec.ptr15, %0 br i1 %cmp, label %while.end16, label %while.body13 diff --git a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll index f7a82f6..7b92ace 100644 --- a/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll +++ b/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll @@ -10,7 +10,7 @@ then.0: no_exit.2: ; preds = %no_exit.2, %then.0 %indvar630 = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <i32> [#uses=4] %gep.upgrd.1 = zext i32 %indvar630 to i64 ; <i64> [#uses=1] - %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %tmp.38 = getelementptr [700 x i32], [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] store i32 0, i32* %tmp.38 %inc.2 = add i32 %indvar630, 2 ; <i32> [#uses=2] %tmp.34 = icmp slt i32 %inc.2, 701 ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll index 16bb508..4a6ec50 100644 --- a/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll +++ b/test/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll @@ -12,9 +12,9 @@ define void @test1({ i32, i32 }* %P) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=3] - %gep1 = getelementptr { i32, i32 }* %P, i32 %INDVAR, i32 0 ; <i32*> [#uses=1] + %gep1 = getelementptr { i32, i32 }, { i32, i32 }* %P, i32 %INDVAR, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %gep1 - %gep2 = getelementptr { i32, i32 }* %P, i32 %INDVAR, i32 1 ; <i32*> [#uses=1] + %gep2 = getelementptr { i32, i32 }, { i32, i32 }* %P, i32 %INDVAR, i32 1 ; <i32*> [#uses=1] store i32 0, i32* %gep2 %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] @@ -28,9 +28,9 @@ define void @test2([2 x i32]* %P) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=3] - %gep1 = getelementptr [2 x i32]* %P, i32 %INDVAR, i64 0 ; <i32*> [#uses=1] + %gep1 = getelementptr [2 x i32], [2 x i32]* %P, i32 %INDVAR, i64 0 ; <i32*> [#uses=1] store i32 0, i32* %gep1 - %gep2 = getelementptr [2 x i32]* %P, i32 %INDVAR, i64 1 ; <i32*> [#uses=1] + %gep2 = getelementptr [2 x i32], [2 x i32]* %P, i32 %INDVAR, i64 1 ; <i32*> [#uses=1] store i32 0, i32* %gep2 %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll b/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll index 2030000..4974f48 100644 --- a/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll +++ b/test/Transforms/LoopStrengthReduce/dont_reduce_bytes.ll @@ -11,7 +11,7 @@ define void @test(i8* %PTR) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr i8* %PTR, i32 %INDVAR ; <i8*> [#uses=1] + %STRRED = getelementptr i8, i8* %PTR, i32 %INDVAR ; <i8*> [#uses=1] store i8 0, i8* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=2] ;; cannot eliminate indvar diff --git a/test/Transforms/LoopStrengthReduce/dont_reverse.ll b/test/Transforms/LoopStrengthReduce/dont_reverse.ll index d65213d..551bd03 100644 --- a/test/Transforms/LoopStrengthReduce/dont_reverse.ll +++ b/test/Transforms/LoopStrengthReduce/dont_reverse.ll @@ -4,6 +4,10 @@ ; Don't reverse the iteration if the rhs of the compare is defined ; inside the loop. +; Provide legal integer types. +; Declare i2 as legal so that IVUsers accepts to consider %indvar3451 +target datalayout = "n2:8:16:32:64" + define void @Fill_Buffer(i2* %p) nounwind { entry: br label %bb8 @@ -11,7 +15,7 @@ entry: bb8: %indvar34 = phi i32 [ 0, %entry ], [ %indvar.next35, %bb8 ] %indvar3451 = trunc i32 %indvar34 to i2 - %xmp4344 = load i2* %p + %xmp4344 = load i2, i2* %p %xmp104 = icmp eq i2 %indvar3451, %xmp4344 %indvar.next35 = add i32 %indvar34, 1 br i1 %xmp104, label %bb10, label %bb8 diff --git a/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll b/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll index 7982fbc..27371b5 100644 --- a/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll +++ b/test/Transforms/LoopStrengthReduce/hoist-parent-preheader.ll @@ -15,7 +15,7 @@ loop2: ; preds = %loop1, %loop2.backe %indvar414 = phi i64 [ %indvar.next415, %loop2.backedge ], [ 0, %loop1 ] %tmp473 = mul i64 %indvar414, -4 %tmp485 = add i64 %tmp484, %tmp473 - %storemerge4 = getelementptr i8* %a, i64 %tmp485 + %storemerge4 = getelementptr i8, i8* %a, i64 %tmp485 %0 = icmp ugt i8* %storemerge4, %a br i1 false, label %loop2.exit, label %loop2.backedge diff --git a/test/Transforms/LoopStrengthReduce/invariant_value_first.ll b/test/Transforms/LoopStrengthReduce/invariant_value_first.ll index 5c18809..4d59ca9 100644 --- a/test/Transforms/LoopStrengthReduce/invariant_value_first.ll +++ b/test/Transforms/LoopStrengthReduce/invariant_value_first.ll @@ -13,7 +13,7 @@ define void @test([10000 x i32]* %P) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] + %STRRED = getelementptr [10000 x i32], [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll b/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll index 8eb8f05..5771640 100644 --- a/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll +++ b/test/Transforms/LoopStrengthReduce/invariant_value_first_arg.ll @@ -10,7 +10,7 @@ define void @test([10000 x i32]* %P, i32 %outer) { br label %Loop Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] + %STRRED = getelementptr [10000 x i32], [10000 x i32]* %P, i32 %outer, i32 %INDVAR ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/ivchain.ll b/test/Transforms/LoopStrengthReduce/ivchain.ll index 233800b..d95220d 100644 --- a/test/Transforms/LoopStrengthReduce/ivchain.ll +++ b/test/Transforms/LoopStrengthReduce/ivchain.ll @@ -4,6 +4,10 @@ ; A sign extend feeds an IVUser and cannot be hoisted into the AddRec. ; CollectIVChains should bailout on this case. + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + %struct = type { i8*, i8*, i16, i64, i16, i16, i16, i64, i64, i16, i8*, i64, i64, i64 } ; CHECK-LABEL: @test( @@ -27,13 +31,13 @@ for.body: ; preds = %sw.epilog, %land.en br label %if.end388 if.end388: ; preds = %if.then380, %if.else356 - %ColLength = getelementptr inbounds %struct* %fbh.0, i64 0, i32 7 + %ColLength = getelementptr inbounds %struct, %struct* %fbh.0, i64 0, i32 7 %call405 = call signext i16 @SQLColAttribute(i8* undef, i16 zeroext %conv258, i16 zeroext 1003, i8* null, i16 signext 0, i16* null, i64* %ColLength) nounwind br label %sw.epilog sw.epilog: ; preds = %sw.bb542, %sw.bb523, %if.end475 %inc601 = add i16 %column_n.0, 1 - %incdec.ptr = getelementptr inbounds %struct* %fbh.0, i64 1 + %incdec.ptr = getelementptr inbounds %struct, %struct* %fbh.0, i64 1 br label %for.body return: ; preds = %entry diff --git a/test/Transforms/LoopStrengthReduce/nested-reduce.ll b/test/Transforms/LoopStrengthReduce/nested-reduce.ll index 58b8d3e..c05b19d 100644 --- a/test/Transforms/LoopStrengthReduce/nested-reduce.ll +++ b/test/Transforms/LoopStrengthReduce/nested-reduce.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -loop-reduce -S | not grep mul +; Provide legal integer types. +target datalayout = "n8:16:32:64" + ; Make sure we don't get a multiply by 6 in this loop. define i32 @foo(i32 %A, i32 %B, i32 %C, i32 %D) { diff --git a/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll b/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll index ec55179..ad2caeb 100644 --- a/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll +++ b/test/Transforms/LoopStrengthReduce/ops_after_indvar.ll @@ -15,7 +15,7 @@ define void @test([10000 x i32]* %P) { Loop: ; preds = %Loop, %0 %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] %idx = call i32 @getidx( ) ; <i32> [#uses=1] - %STRRED = getelementptr [10000 x i32]* %P, i32 %INDVAR, i32 %idx ; <i32*> [#uses=1] + %STRRED = getelementptr [10000 x i32], [10000 x i32]* %P, i32 %INDVAR, i32 %idx ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %cond = call i1 @pred( ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll b/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll index 7ef494d..6943ab9 100644 --- a/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll +++ b/test/Transforms/LoopStrengthReduce/phi_node_update_multiple_preds.ll @@ -10,12 +10,12 @@ entry: shortcirc_next: ; preds = %no_exit.2, %entry %indvar37 = phi i32 [ 0, %entry ], [ %indvar.next38, %no_exit.2 ] ; <i32> [#uses=3] %gep.upgrd.1 = zext i32 %indvar37 to i64 ; <i64> [#uses=1] - %wp.2.4 = getelementptr i8* null, i64 %gep.upgrd.1 ; <i8*> [#uses=1] + %wp.2.4 = getelementptr i8, i8* null, i64 %gep.upgrd.1 ; <i8*> [#uses=1] br i1 false, label %loopexit.2, label %no_exit.2 no_exit.2: ; preds = %shortcirc_next %wp.2.4.rec = bitcast i32 %indvar37 to i32 ; <i32> [#uses=1] %inc.1.rec = add i32 %wp.2.4.rec, 1 ; <i32> [#uses=1] - %inc.1 = getelementptr i8* null, i32 %inc.1.rec ; <i8*> [#uses=2] + %inc.1 = getelementptr i8, i8* null, i32 %inc.1.rec ; <i8*> [#uses=2] %indvar.next38 = add i32 %indvar37, 1 ; <i32> [#uses=1] switch i8 0, label %shortcirc_next [ i8 32, label %loopexit.2 diff --git a/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll b/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll index 45aeb4e..092b274 100644 --- a/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll +++ b/test/Transforms/LoopStrengthReduce/post-inc-icmpzero.ll @@ -23,19 +23,19 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @_Z15IntegerToStringjjR7Vector2(i32 %i, i32 %radix, %struct.Vector2* nocapture %result) nounwind noinline { entry: %buffer = alloca [33 x i16], align 16 - %add.ptr = getelementptr inbounds [33 x i16]* %buffer, i64 0, i64 33 + %add.ptr = getelementptr inbounds [33 x i16], [33 x i16]* %buffer, i64 0, i64 33 br label %do.body do.body: ; preds = %do.body, %entry %0 = phi i64 [ %indvar.next44, %do.body ], [ 0, %entry ] %i.addr.0 = phi i32 [ %div, %do.body ], [ %i, %entry ] %tmp51 = sub i64 32, %0 - %incdec.ptr = getelementptr [33 x i16]* %buffer, i64 0, i64 %tmp51 + %incdec.ptr = getelementptr [33 x i16], [33 x i16]* %buffer, i64 0, i64 %tmp51 %rem = urem i32 %i.addr.0, 10 %div = udiv i32 %i.addr.0, 10 %idxprom = zext i32 %rem to i64 - %arrayidx = getelementptr inbounds [37 x i8]* @.str, i64 0, i64 %idxprom - %tmp5 = load i8* %arrayidx, align 1 + %arrayidx = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %idxprom + %tmp5 = load i8, i8* %arrayidx, align 1 %conv = sext i8 %tmp5 to i16 store i16 %conv, i16* %incdec.ptr, align 2 %1 = icmp ugt i32 %i.addr.0, 9 @@ -50,30 +50,30 @@ do.end: ; preds = %do.body %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %sub.ptr.div39 = lshr exact i64 %sub.ptr.sub, 1 %conv11 = trunc i64 %sub.ptr.div39 to i32 - %mLength = getelementptr inbounds %struct.Vector2* %result, i64 0, i32 2 + %mLength = getelementptr inbounds %struct.Vector2, %struct.Vector2* %result, i64 0, i32 2 %idx.ext21 = bitcast i64 %sub.ptr.div39 to i64 %incdec.ptr.sum = add i64 %idx.ext21, -1 %cp.0.sum = sub i64 %incdec.ptr.sum, %0 - %add.ptr22 = getelementptr [33 x i16]* %buffer, i64 1, i64 %cp.0.sum + %add.ptr22 = getelementptr [33 x i16], [33 x i16]* %buffer, i64 1, i64 %cp.0.sum %cmp2740 = icmp eq i64 %idx.ext21, 0 br i1 %cmp2740, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %do.end - %tmp16 = load i32* %mLength, align 4 - %mBegin = getelementptr inbounds %struct.Vector2* %result, i64 0, i32 0 - %tmp14 = load i16** %mBegin, align 8 + %tmp16 = load i32, i32* %mLength, align 4 + %mBegin = getelementptr inbounds %struct.Vector2, %struct.Vector2* %result, i64 0, i32 0 + %tmp14 = load i16*, i16** %mBegin, align 8 %tmp48 = zext i32 %tmp16 to i64 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.body ] %tmp46 = add i64 %tmp51, %indvar - %p.042 = getelementptr [33 x i16]* %buffer, i64 0, i64 %tmp46 + %p.042 = getelementptr [33 x i16], [33 x i16]* %buffer, i64 0, i64 %tmp46 %tmp47 = sub i64 %indvar, %0 - %incdec.ptr32 = getelementptr [33 x i16]* %buffer, i64 1, i64 %tmp47 + %incdec.ptr32 = getelementptr [33 x i16], [33 x i16]* %buffer, i64 1, i64 %tmp47 %tmp49 = add i64 %tmp48, %indvar - %dst.041 = getelementptr i16* %tmp14, i64 %tmp49 - %tmp29 = load i16* %p.042, align 2 + %dst.041 = getelementptr i16, i16* %tmp14, i64 %tmp49 + %tmp29 = load i16, i16* %p.042, align 2 store i16 %tmp29, i16* %dst.041, align 2 %cmp27 = icmp eq i16* %incdec.ptr32, %add.ptr22 %indvar.next = add i64 %indvar, 1 @@ -83,7 +83,7 @@ for.end.loopexit: ; preds = %for.body br label %for.end for.end: ; preds = %for.end.loopexit, %do.end - %tmp38 = load i32* %mLength, align 4 + %tmp38 = load i32, i32* %mLength, align 4 %add = add i32 %tmp38, %conv11 store i32 %add, i32* %mLength, align 4 ret void diff --git a/test/Transforms/LoopStrengthReduce/pr12018.ll b/test/Transforms/LoopStrengthReduce/pr12018.ll index e493cf8..df969ee 100644 --- a/test/Transforms/LoopStrengthReduce/pr12018.ll +++ b/test/Transforms/LoopStrengthReduce/pr12018.ll @@ -12,15 +12,15 @@ entry: for.body: ; preds = %_ZN8nsTArray9ElementAtEi.exit, %entry %i.06 = phi i32 [ %add, %_ZN8nsTArray9ElementAtEi.exit ], [ 0, %entry ] %call.i = call %struct.nsTArrayHeader* @_ZN8nsTArray4Hdr2Ev() nounwind - %add.ptr.i = getelementptr inbounds %struct.nsTArrayHeader* %call.i, i32 1 + %add.ptr.i = getelementptr inbounds %struct.nsTArrayHeader, %struct.nsTArrayHeader* %call.i, i32 1 %tmp = bitcast %struct.nsTArrayHeader* %add.ptr.i to %struct.nsTArray* - %arrayidx = getelementptr inbounds %struct.nsTArray* %tmp, i32 %i.06 + %arrayidx = getelementptr inbounds %struct.nsTArray, %struct.nsTArray* %tmp, i32 %i.06 %add = add nsw i32 %i.06, 1 call void @llvm.dbg.value(metadata %struct.nsTArray* %aValues, i64 0, metadata !0, metadata !{}) nounwind br label %_ZN8nsTArray9ElementAtEi.exit _ZN8nsTArray9ElementAtEi.exit: ; preds = %for.body - %arrayidx.i = getelementptr inbounds %struct.nsTArray* %tmp, i32 %add + %arrayidx.i = getelementptr inbounds %struct.nsTArray, %struct.nsTArray* %tmp, i32 %add call void @_ZN11nsTArray15ComputeDistanceERKS_Rd(%struct.nsTArray* %arrayidx, %struct.nsTArray* %arrayidx.i) nounwind %cmp = icmp slt i32 %add, %foo br i1 %cmp, label %for.body, label %for.end @@ -35,4 +35,4 @@ declare %struct.nsTArrayHeader* @_ZN8nsTArray4Hdr2Ev() declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone -!0 = !{!"0x101"} ; [ DW_TAG_arg_variable ] +!0 = !MDLocalVariable(tag: DW_TAG_arg_variable) diff --git a/test/Transforms/LoopStrengthReduce/pr12048.ll b/test/Transforms/LoopStrengthReduce/pr12048.ll index 7e0f2ad..212004b 100644 --- a/test/Transforms/LoopStrengthReduce/pr12048.ll +++ b/test/Transforms/LoopStrengthReduce/pr12048.ll @@ -13,8 +13,8 @@ while.cond40: i8 0, label %if.then59 ] while.body51: ; preds = %land.end50 - %incdec.ptr = getelementptr inbounds i8* %tmp.1, i64 1 - %scevgep = getelementptr i8* %indvars.iv194, i64 1 + %incdec.ptr = getelementptr inbounds i8, i8* %tmp.1, i64 1 + %scevgep = getelementptr i8, i8* %indvars.iv194, i64 1 br label %while.cond40 if.then59: ; preds = %while.end br i1 undef, label %if.then64, label %if.end113 @@ -29,7 +29,7 @@ while.cond132.preheader: ; preds = %if.end113 %cmp133173 = icmp eq i8* %tmp.1, %tmp.4 br i1 %cmp133173, label %while.cond40.preheader, label %while.body139.lr.ph while.body139.lr.ph: ; preds = %while.cond132.preheader - %scevgep198 = getelementptr i8* %indvars.iv194, i64 0 + %scevgep198 = getelementptr i8, i8* %indvars.iv194, i64 0 %scevgep198199 = ptrtoint i8* %scevgep198 to i64 br label %while.body139 while.body139: ; preds = %while.body139, %while.body139.lr.ph diff --git a/test/Transforms/LoopStrengthReduce/pr12691.ll b/test/Transforms/LoopStrengthReduce/pr12691.ll index 8399434..e33e405 100644 --- a/test/Transforms/LoopStrengthReduce/pr12691.ll +++ b/test/Transforms/LoopStrengthReduce/pr12691.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -loop-reduce -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + @d = common global i32 0, align 4 define void @fn2(i32 %x) nounwind uwtable { @@ -13,13 +16,13 @@ for.cond: br i1 %tobool, label %for.cond, label %for.end for.end: -; CHECK: %tmp1 = load i32* @d, align 4 -; CHECK-NEXT: %tmp2 = load i32* @d, align 4 +; CHECK: %tmp1 = load i32, i32* @d, align 4 +; CHECK-NEXT: %tmp2 = load i32, i32* @d, align 4 ; CHECK-NEXT: %0 = sub i32 %tmp1, %tmp2 - %tmp1 = load i32* @d, align 4 + %tmp1 = load i32, i32* @d, align 4 %add = add nsw i32 %tmp1, %g.0 - %tmp2 = load i32* @d, align 4 + %tmp2 = load i32, i32* @d, align 4 %tobool26 = icmp eq i32 %x, 0 br i1 %tobool26, label %for.end5, label %for.body.lr.ph diff --git a/test/Transforms/LoopStrengthReduce/pr18165.ll b/test/Transforms/LoopStrengthReduce/pr18165.ll index cc878c4..42d960f 100644 --- a/test/Transforms/LoopStrengthReduce/pr18165.ll +++ b/test/Transforms/LoopStrengthReduce/pr18165.ll @@ -20,10 +20,10 @@ target triple = "x86_64-apple-macosx10.9.0" ; Function Attrs: nounwind optsize ssp uwtable define i32 @main() #0 { entry: - %0 = load i32* getelementptr inbounds (%struct.anon* @a, i64 0, i32 0), align 4, !tbaa !1 + %0 = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 0), align 4, !tbaa !1 %tobool7.i = icmp eq i32 %0, 0 - %.promoted.i = load i32* getelementptr inbounds (%struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 - %f.promoted.i = load i32* @f, align 4, !tbaa !7 + %.promoted.i = load i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 + %f.promoted.i = load i32, i32* @f, align 4, !tbaa !7 br label %for.body6.i.outer for.body6.i.outer: ; preds = %entry, %lor.end.i @@ -42,7 +42,7 @@ if.end9.i: ; preds = %for.body6.i.outer br i1 %tobool12.i, label %lor.rhs.i, label %lor.end.i lor.rhs.i: ; preds = %if.end9.i - %1 = load i32* @b, align 4, !tbaa !7 + %1 = load i32, i32* @b, align 4, !tbaa !7 %dec.i = add nsw i32 %1, -1 store i32 %dec.i, i32* @b, align 4, !tbaa !7 %tobool13.i = icmp ne i32 %1, 0 @@ -59,12 +59,12 @@ lor.end.i: ; preds = %lor.rhs.i, %if.end9 fn1.exit: ; preds = %lor.end.i store i32 0, i32* @g, align 4, !tbaa !7 - store i32 %or14.i, i32* getelementptr inbounds (%struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 + store i32 %or14.i, i32* getelementptr inbounds (%struct.anon, %struct.anon* @a, i64 0, i32 2), align 4, !tbaa !6 store i32 %or15.i, i32* @f, align 4, !tbaa !7 - store i32 %add.i, i32* getelementptr inbounds (%struct.anon* @e, i64 0, i32 1), align 4, !tbaa !8 + store i32 %add.i, i32* getelementptr inbounds (%struct.anon, %struct.anon* @e, i64 0, i32 1), align 4, !tbaa !8 store i32 0, i32* @h, align 4, !tbaa !7 - %3 = load i32* @b, align 4, !tbaa !7 - %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %3) #2 + %3 = load i32, i32* @b, align 4, !tbaa !7 + %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2 ret i32 0 } diff --git a/test/Transforms/LoopStrengthReduce/pr2570.ll b/test/Transforms/LoopStrengthReduce/pr2570.ll index 7b56971..671ffde 100644 --- a/test/Transforms/LoopStrengthReduce/pr2570.ll +++ b/test/Transforms/LoopStrengthReduce/pr2570.ll @@ -23,7 +23,7 @@ define i32 @func_44(i32 %p_45, i32 %p_46, i16 zeroext %p_48, i32 %p_49, i8 zero entry: tail call i32 @func_116( i8 zeroext 2 ) nounwind ; <i32>:0 [#uses=0] tail call i32 @func_63( i16 signext 2 ) nounwind ; <i32>:1 [#uses=1] - load i16* @g_39, align 2 ; <i16>:2 [#uses=1] + load i16, i16* @g_39, align 2 ; <i16>:2 [#uses=1] tail call i32 @func_63( i16 signext %2 ) nounwind ; <i32>:3 [#uses=1] trunc i32 %3 to i16 ; <i16>:4 [#uses=1] and i16 %4, 1 ; <i16>:5 [#uses=1] @@ -32,10 +32,10 @@ entry: tail call i32 @func_74( i16 zeroext %5, i8 zeroext %6, i16 zeroext %7, i16 zeroext 0 ) nounwind ; <i32>:8 [#uses=0] tail call i32 @func_124( i32 544824386 ) nounwind ; <i32>:9 [#uses=0] zext i8 %p_50 to i32 ; <i32>:10 [#uses=1] - load i32* @g_43, align 4 ; <i32>:11 [#uses=1] + load i32, i32* @g_43, align 4 ; <i32>:11 [#uses=1] icmp sle i32 %10, %11 ; <i1>:12 [#uses=1] zext i1 %12 to i32 ; <i32>:13 [#uses=2] - load i8* @g_247, align 1 ; <i8>:14 [#uses=1] + load i8, i8* @g_247, align 1 ; <i8>:14 [#uses=1] trunc i32 %p_45 to i16 ; <i16>:15 [#uses=1] zext i8 %14 to i16 ; <i16>:16 [#uses=1] tail call i32 @func_74( i16 zeroext %15, i8 zeroext 0, i16 zeroext %16, i16 zeroext 23618 ) nounwind ; <i32>:17 [#uses=4] @@ -72,7 +72,7 @@ bb172: ; preds = %bb168, %bb162 icmp eq i32 %.0343, 0 ; <i1>:30 [#uses=1] %.0341 = select i1 %30, i32 1, i32 %.0343 ; <i32> [#uses=1] urem i32 %23, %.0341 ; <i32>:31 [#uses=1] - load i32* @g_137, align 4 ; <i32>:32 [#uses=4] + load i32, i32* @g_137, align 4 ; <i32>:32 [#uses=4] icmp slt i32 %32, 0 ; <i1>:33 [#uses=1] br i1 %33, label %bb202, label %bb198 @@ -119,13 +119,13 @@ bb222: ; preds = %bb215, %bb205 bb223: ; preds = %bb222, %bb215 %iftmp.437.0 = phi i32 [ 0, %bb222 ], [ 1, %bb215 ] ; <i32> [#uses=1] - load i32* @g_91, align 4 ; <i32>:55 [#uses=3] + load i32, i32* @g_91, align 4 ; <i32>:55 [#uses=3] tail call i32 @func_103( i16 zeroext 4 ) nounwind ; <i32>:56 [#uses=0] tail call i32 @func_112( i32 0, i16 zeroext -31374 ) nounwind ; <i32>:57 [#uses=0] - load i32* @g_197, align 4 ; <i32>:58 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:58 [#uses=1] tail call i32 @func_124( i32 28156 ) nounwind ; <i32>:59 [#uses=1] - load i32* @g_260, align 4 ; <i32>:60 [#uses=1] - load i32* @g_43, align 4 ; <i32>:61 [#uses=1] + load i32, i32* @g_260, align 4 ; <i32>:60 [#uses=1] + load i32, i32* @g_43, align 4 ; <i32>:61 [#uses=1] xor i32 %61, %60 ; <i32>:62 [#uses=1] mul i32 %62, %59 ; <i32>:63 [#uses=1] trunc i32 %63 to i8 ; <i8>:64 [#uses=1] @@ -138,7 +138,7 @@ bb223: ; preds = %bb222, %bb215 %or.cond352 = or i1 %70, %67 ; <i1> [#uses=1] select i1 %or.cond352, i32 0, i32 %55 ; <i32>:71 [#uses=1] %.353 = ashr i32 %66, %71 ; <i32> [#uses=2] - load i16* @g_221, align 2 ; <i16>:72 [#uses=1] + load i16, i16* @g_221, align 2 ; <i16>:72 [#uses=1] zext i16 %72 to i32 ; <i32>:73 [#uses=1] icmp ugt i32 %.353, 31 ; <i1>:74 [#uses=1] select i1 %74, i32 0, i32 %.353 ; <i32>:75 [#uses=1] @@ -146,7 +146,7 @@ bb223: ; preds = %bb222, %bb215 add i32 %.0323, %iftmp.437.0 ; <i32>:76 [#uses=1] and i32 %48, 255 ; <i32>:77 [#uses=2] add i32 %77, 2042556439 ; <i32>:78 [#uses=1] - load i32* @g_207, align 4 ; <i32>:79 [#uses=2] + load i32, i32* @g_207, align 4 ; <i32>:79 [#uses=2] icmp ugt i32 %79, 31 ; <i1>:80 [#uses=1] select i1 %80, i32 0, i32 %79 ; <i32>:81 [#uses=1] %.0320 = lshr i32 %77, %81 ; <i32> [#uses=1] @@ -154,7 +154,7 @@ bb223: ; preds = %bb222, %bb215 zext i1 %82 to i8 ; <i8>:83 [#uses=1] tail call i32 @func_25( i8 zeroext %83 ) nounwind ; <i32>:84 [#uses=1] xor i32 %84, 1 ; <i32>:85 [#uses=1] - load i32* @g_197, align 4 ; <i32>:86 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:86 [#uses=1] add i32 %86, 1 ; <i32>:87 [#uses=1] add i32 %87, %85 ; <i32>:88 [#uses=1] icmp ugt i32 %76, %88 ; <i1>:89 [#uses=1] @@ -163,22 +163,22 @@ bb223: ; preds = %bb222, %bb215 bb241: ; preds = %bb223 store i16 -9, i16* @g_221, align 2 udiv i32 %p_52, 1538244727 ; <i32>:90 [#uses=1] - load i32* @g_207, align 4 ; <i32>:91 [#uses=1] + load i32, i32* @g_207, align 4 ; <i32>:91 [#uses=1] sub i32 %91, %90 ; <i32>:92 [#uses=1] - load i32* @g_14, align 4 ; <i32>:93 [#uses=1] + load i32, i32* @g_14, align 4 ; <i32>:93 [#uses=1] trunc i32 %93 to i16 ; <i16>:94 [#uses=1] trunc i32 %p_46 to i16 ; <i16>:95 [#uses=2] sub i16 %94, %95 ; <i16>:96 [#uses=1] - load i32* @g_197, align 4 ; <i32>:97 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:97 [#uses=1] trunc i32 %97 to i16 ; <i16>:98 [#uses=1] tail call i32 @func_55( i32 -346178830, i16 zeroext %98, i16 zeroext %95 ) nounwind ; <i32>:99 [#uses=0] zext i16 %p_48 to i32 ; <i32>:100 [#uses=1] - load i8* @g_247, align 1 ; <i8>:101 [#uses=1] + load i8, i8* @g_247, align 1 ; <i8>:101 [#uses=1] zext i8 %101 to i32 ; <i32>:102 [#uses=1] sub i32 %100, %102 ; <i32>:103 [#uses=1] tail call i32 @func_55( i32 %103, i16 zeroext -2972, i16 zeroext %96 ) nounwind ; <i32>:104 [#uses=0] xor i32 %92, 2968 ; <i32>:105 [#uses=1] - load i32* @g_197, align 4 ; <i32>:106 [#uses=1] + load i32, i32* @g_197, align 4 ; <i32>:106 [#uses=1] icmp ugt i32 %105, %106 ; <i1>:107 [#uses=1] zext i1 %107 to i32 ; <i32>:108 [#uses=1] store i32 %108, i32* @g_33, align 4 @@ -195,12 +195,12 @@ bb248: ; preds = %bb284, %bb241 bb272.thread: ; preds = %bb248 store i32 1, i32* @g_82 - load i16* @g_267, align 2 ; <i16>:111 [#uses=1] + load i16, i16* @g_267, align 2 ; <i16>:111 [#uses=1] icmp eq i16 %111, 0 ; <i1>:112 [#uses=1] br i1 %112, label %bb311.loopexit.split, label %bb268 bb255.thread: ; preds = %bb248 - load i32* @g_260, align 4 ; <i32>:113 [#uses=1] + load i32, i32* @g_260, align 4 ; <i32>:113 [#uses=1] sub i32 %113, %p_52 ; <i32>:114 [#uses=1] and i32 %114, -20753 ; <i32>:115 [#uses=1] icmp ne i32 %115, 0 ; <i1>:116 [#uses=1] @@ -237,7 +237,7 @@ bb284: ; preds = %bb279, %bb276, %bb255.thread %p_49_addr.0 = phi i32 [ %p_49_addr.1.reg2mem.0, %bb279 ], [ %p_49_addr.1.reg2mem.0, %bb276 ], [ 0, %bb255.thread ] ; <i32> [#uses=1] %p_48_addr.1 = phi i16 [ %124, %bb279 ], [ %118, %bb276 ], [ %p_48_addr.2.reg2mem.0, %bb255.thread ] ; <i16> [#uses=1] %p_45_addr.0 = phi i32 [ %p_45_addr.1.reg2mem.0, %bb279 ], [ %p_45_addr.1.reg2mem.0, %bb276 ], [ 8, %bb255.thread ] ; <i32> [#uses=3] - load i32* @g_43, align 4 ; <i32>:125 [#uses=1] + load i32, i32* @g_43, align 4 ; <i32>:125 [#uses=1] trunc i32 %125 to i8 ; <i8>:126 [#uses=1] tail call i32 @func_116( i8 zeroext %126 ) nounwind ; <i32>:127 [#uses=0] lshr i32 65255, %p_45_addr.0 ; <i32>:128 [#uses=1] @@ -245,7 +245,7 @@ bb284: ; preds = %bb279, %bb276, %bb255.thread %.op = lshr i32 %128, 31 ; <i32> [#uses=1] %.op.op = xor i32 %.op, 1 ; <i32> [#uses=1] %.354..lobit.not = select i1 %129, i32 1, i32 %.op.op ; <i32> [#uses=1] - load i16* @g_39, align 2 ; <i16>:130 [#uses=1] + load i16, i16* @g_39, align 2 ; <i16>:130 [#uses=1] zext i16 %130 to i32 ; <i32>:131 [#uses=1] icmp slt i32 %.354..lobit.not, %131 ; <i1>:132 [#uses=1] zext i1 %132 to i32 ; <i32>:133 [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/pr3086.ll b/test/Transforms/LoopStrengthReduce/pr3086.ll index 599633a..187c14f 100644 --- a/test/Transforms/LoopStrengthReduce/pr3086.ll +++ b/test/Transforms/LoopStrengthReduce/pr3086.ll @@ -10,18 +10,18 @@ entry: br label %bb11 bb5: ; preds = %bb9 - %0 = load %struct.Lit** %storemerge, align 8 ; <%struct.Lit*> [#uses=0] + %0 = load %struct.Lit*, %struct.Lit** %storemerge, align 8 ; <%struct.Lit*> [#uses=0] %indvar.next8 = add i64 %storemerge.rec, 1 ; <i64> [#uses=1] br label %bb9 bb9: ; preds = %bb22, %bb5 %storemerge.rec = phi i64 [ %indvar.next8, %bb5 ], [ 0, %bb22 ] ; <i64> [#uses=2] - %storemerge = getelementptr %struct.Lit** null, i64 %storemerge.rec ; <%struct.Lit**> [#uses=2] + %storemerge = getelementptr %struct.Lit*, %struct.Lit** null, i64 %storemerge.rec ; <%struct.Lit**> [#uses=2] %1 = icmp ugt %struct.Lit** null, %storemerge ; <i1> [#uses=1] br i1 %1, label %bb5, label %bb22 bb11: ; preds = %bb22, %entry - %2 = load %struct.Cls** null, align 8 ; <%struct.Cls*> [#uses=0] + %2 = load %struct.Cls*, %struct.Cls** null, align 8 ; <%struct.Cls*> [#uses=0] br label %bb22 bb22: ; preds = %bb11, %bb9 diff --git a/test/Transforms/LoopStrengthReduce/pr3399.ll b/test/Transforms/LoopStrengthReduce/pr3399.ll index 26c5002..1037768 100644 --- a/test/Transforms/LoopStrengthReduce/pr3399.ll +++ b/test/Transforms/LoopStrengthReduce/pr3399.ll @@ -13,7 +13,7 @@ bb: ; preds = %bb5, %bb5.thread bb1: ; preds = %bb %l_2.0.reg2mem.0 = sub i32 0, %indvar ; <i32> [#uses=1] - %0 = load volatile i32* @g_53, align 4 ; <i32> [#uses=1] + %0 = load volatile i32, i32* @g_53, align 4 ; <i32> [#uses=1] %1 = trunc i32 %l_2.0.reg2mem.0 to i16 ; <i16> [#uses=1] %2 = trunc i32 %0 to i16 ; <i16> [#uses=1] %3 = mul i16 %2, %1 ; <i16> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/pr3571.ll b/test/Transforms/LoopStrengthReduce/pr3571.ll index a23e4db..1615a81 100644 --- a/test/Transforms/LoopStrengthReduce/pr3571.ll +++ b/test/Transforms/LoopStrengthReduce/pr3571.ll @@ -12,7 +12,7 @@ bb.i: ; preds = %_ZNK11QModelIndex7isValidEv.exit.i _ZNK11QModelIndex7isValidEv.exit.i: ; preds = %bb.i, %entry %result.0.i = phi i32 [ 0, %entry ], [ %indvar.next, %bb.i ] ; <i32> [#uses=2] - %0 = load i32** null, align 4 ; <%struct.QAbstractItemDelegate*> [#uses=0] + %0 = load i32*, i32** null, align 4 ; <%struct.QAbstractItemDelegate*> [#uses=0] br i1 false, label %_ZN18qdesigner_internalL5levelEP18QAbstractItemModelRK11QModelIndex.exit, label %bb.i _ZN18qdesigner_internalL5levelEP18QAbstractItemModelRK11QModelIndex.exit: ; preds = %_ZNK11QModelIndex7isValidEv.exit.i diff --git a/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll b/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll index f90d030..2b9920c 100644 --- a/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll +++ b/test/Transforms/LoopStrengthReduce/preserve-gep-loop-variant.ll @@ -28,7 +28,7 @@ for.body: %conv3 = sext i8 %conv to i64 %add = add nsw i64 %call, %storemerge1 %add4 = add nsw i64 %add, %conv3 - %arrayidx = getelementptr inbounds i8* %p, i64 %add4 + %arrayidx = getelementptr inbounds i8, i8* %p, i64 %add4 store i8 0, i8* %arrayidx %inc = add nsw i64 %storemerge1, 1 br label %for.cond diff --git a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll index 65aa61f..483becc 100644 --- a/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll +++ b/test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll @@ -1,5 +1,8 @@ ; RUN: opt < %s -analyze -iv-users | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + ; The value of %r is dependent on a polynomial iteration expression. ; ; CHECK-LABEL: IV Users for loop %foo.loop diff --git a/test/Transforms/LoopStrengthReduce/related_indvars.ll b/test/Transforms/LoopStrengthReduce/related_indvars.ll index 12942bf..fbe8ffd 100644 --- a/test/Transforms/LoopStrengthReduce/related_indvars.ll +++ b/test/Transforms/LoopStrengthReduce/related_indvars.ll @@ -14,9 +14,9 @@ entry: no_exit: ; preds = %no_exit, %entry %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %no_exit ] ; <i32> [#uses=2] %D_addr.0.0.rec = bitcast i32 %indvar to i32 ; <i32> [#uses=2] - %D_addr.0.0 = getelementptr double* %D, i32 %D_addr.0.0.rec ; <double*> [#uses=1] + %D_addr.0.0 = getelementptr double, double* %D, i32 %D_addr.0.0.rec ; <double*> [#uses=1] %inc.rec = add i32 %D_addr.0.0.rec, 1 ; <i32> [#uses=1] - %inc = getelementptr double* %D, i32 %inc.rec ; <double*> [#uses=1] + %inc = getelementptr double, double* %D, i32 %inc.rec ; <double*> [#uses=1] store double %F, double* %D_addr.0.0 %tmp.2 = icmp eq double* %inc, %E ; <i1> [#uses=1] %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/remove_indvar.ll b/test/Transforms/LoopStrengthReduce/remove_indvar.ll index bb39532..3b92c25 100644 --- a/test/Transforms/LoopStrengthReduce/remove_indvar.ll +++ b/test/Transforms/LoopStrengthReduce/remove_indvar.ll @@ -1,6 +1,9 @@ ; Check that this test makes INDVAR and related stuff dead. ; RUN: opt < %s -loop-reduce -S | not grep INDVAR +; Provide legal integer types. +target datalayout = "n8:16:32:64" + declare i1 @pred() define void @test(i32* %P) { @@ -9,7 +12,7 @@ define void @test(i32* %P) { Loop: ; preds = %Loop, %0 %i = phi i32 [ 0, %0 ], [ %i.next, %Loop ] %INDVAR = phi i32 [ 0, %0 ], [ %INDVAR2, %Loop ] ; <i32> [#uses=2] - %STRRED = getelementptr i32* %P, i32 %INDVAR ; <i32*> [#uses=1] + %STRRED = getelementptr i32, i32* %P, i32 %INDVAR ; <i32*> [#uses=1] store i32 0, i32* %STRRED %INDVAR2 = add i32 %INDVAR, 1 ; <i32> [#uses=1] %i.next = add i32 %i, 1 diff --git a/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll b/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll index a652a76..27212d7 100644 --- a/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll +++ b/test/Transforms/LoopStrengthReduce/scaling_factor_cost_crash.ll @@ -55,7 +55,7 @@ define void @scalingFactorCrash() { ; <label>:16 ; preds = %16, %15 %17 = phi i32 [ %21, %16 ], [ undef, %15 ] %18 = sub i32 %17, 1623127498 - %19 = getelementptr inbounds i32* undef, i32 %18 + %19 = getelementptr inbounds i32, i32* undef, i32 %18 store i32 undef, i32* %19, align 4 %20 = add i32 %17, 1623127499 %21 = add i32 %20, -1623127498 diff --git a/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll b/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll index 412a716..1035ce1 100644 --- a/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll +++ b/test/Transforms/LoopStrengthReduce/share_code_in_preheader.ll @@ -12,10 +12,10 @@ no_exit: ; preds = %no_exit, %entry %indvar = bitcast i32 %indvar.ui to i32 ; <i32> [#uses=1] %N_addr.0.0 = sub i32 %N.s, %indvar ; <i32> [#uses=1] %tmp.8 = add i32 %N_addr.0.0, %tmp.6 ; <i32> [#uses=2] - %tmp.9 = getelementptr i8* %A, i32 %tmp.8 ; <i8*> [#uses=1] - %tmp.10 = load i8* %tmp.9 ; <i8> [#uses=1] - %tmp.17 = getelementptr i8* %B, i32 %tmp.8 ; <i8*> [#uses=1] - %tmp.18 = load i8* %tmp.17 ; <i8> [#uses=1] + %tmp.9 = getelementptr i8, i8* %A, i32 %tmp.8 ; <i8*> [#uses=1] + %tmp.10 = load i8, i8* %tmp.9 ; <i8> [#uses=1] + %tmp.17 = getelementptr i8, i8* %B, i32 %tmp.8 ; <i8*> [#uses=1] + %tmp.18 = load i8, i8* %tmp.17 ; <i8> [#uses=1] %tmp.19 = sub i8 %tmp.10, %tmp.18 ; <i8> [#uses=1] %tmp.21 = add i8 %tmp.19, %Sum.0.0 ; <i8> [#uses=2] %indvar.next = add i32 %indvar.ui, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll b/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll index 2c65261..a81e314 100644 --- a/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll +++ b/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll @@ -27,7 +27,7 @@ bb3: ; preds = %bb2, %bb ; CHECK: bb10: ; CHECK-NEXT: %t7 = icmp eq i16 %t4, 0 ; Host %t2 computation outside the loop. -; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8 addrspace(1)* undef, i16 %t4 +; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* undef, i16 %t4 ; CHECK-NEXT: br label %bb14 bb10: ; preds = %bb9 %t7 = icmp eq i16 %t4, 0 ; <i1> [#uses=1] @@ -36,20 +36,20 @@ bb10: ; preds = %bb9 ; CHECK: bb14: ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[SCEVGEP]] -; CHECK-NEXT: %t6 = load float addrspace(1)* addrspace(1)* undef +; CHECK-NEXT: %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef ; Fold %t3's add within the address. -; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float addrspace(1)* %t6, i16 4 +; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float, float addrspace(1)* %t6, i16 4 ; CHECK-NEXT: [[SCEVGEP2:%[^ ]+]] = bitcast float addrspace(1)* [[SCEVGEP1]] to i8 addrspace(1)* ; Use the induction variable (%t4) to access the right element -; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 +; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8, i8 addrspace(1)* [[SCEVGEP2]], i16 %t4 ; CHECK-NEXT: store i8 undef, i8 addrspace(1)* [[ADDRESS]] ; CHECK-NEXT: br label %bb14 bb14: ; preds = %bb14, %bb10 - %t2 = getelementptr inbounds i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] + %t2 = getelementptr inbounds i8, i8 addrspace(1)* undef, i16 %t4 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t2 - %t6 = load float addrspace(1)* addrspace(1)* undef + %t6 = load float addrspace(1)*, float addrspace(1)* addrspace(1)* undef %t8 = bitcast float addrspace(1)* %t6 to i8 addrspace(1)* ; <i8*> [#uses=1] - %t9 = getelementptr inbounds i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] + %t9 = getelementptr inbounds i8, i8 addrspace(1)* %t8, i16 %t3 ; <i8*> [#uses=1] store i8 undef, i8 addrspace(1)* %t9 br label %bb14 } diff --git a/test/Transforms/LoopStrengthReduce/uglygep.ll b/test/Transforms/LoopStrengthReduce/uglygep.ll index 5155087..430127b 100644 --- a/test/Transforms/LoopStrengthReduce/uglygep.ll +++ b/test/Transforms/LoopStrengthReduce/uglygep.ll @@ -24,7 +24,7 @@ bb3: ; preds = %bb2, %bb ; CHECK: bb10: ; CHECK-NEXT: %t7 = icmp eq i64 %t4, 0 ; Host %t2 computation outside the loop. -; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8* undef, i64 %t4 +; CHECK-NEXT: [[SCEVGEP:%[^ ]+]] = getelementptr i8, i8* undef, i64 %t4 ; CHECK-NEXT: br label %bb14 bb10: ; preds = %bb9 %t7 = icmp eq i64 %t4, 0 ; <i1> [#uses=1] @@ -33,20 +33,20 @@ bb10: ; preds = %bb9 ; CHECK: bb14: ; CHECK-NEXT: store i8 undef, i8* [[SCEVGEP]] -; CHECK-NEXT: %t6 = load float** undef +; CHECK-NEXT: %t6 = load float*, float** undef ; Fold %t3's add within the address. -; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float* %t6, i64 4 +; CHECK-NEXT: [[SCEVGEP1:%[^ ]+]] = getelementptr float, float* %t6, i64 4 ; CHECK-NEXT: [[SCEVGEP2:%[^ ]+]] = bitcast float* [[SCEVGEP1]] to i8* ; Use the induction variable (%t4) to access the right element -; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8* [[SCEVGEP2]], i64 %t4 +; CHECK-NEXT: [[ADDRESS:%[^ ]+]] = getelementptr i8, i8* [[SCEVGEP2]], i64 %t4 ; CHECK-NEXT: store i8 undef, i8* [[ADDRESS]] ; CHECK-NEXT: br label %bb14 bb14: ; preds = %bb14, %bb10 - %t2 = getelementptr inbounds i8* undef, i64 %t4 ; <i8*> [#uses=1] + %t2 = getelementptr inbounds i8, i8* undef, i64 %t4 ; <i8*> [#uses=1] store i8 undef, i8* %t2 - %t6 = load float** undef + %t6 = load float*, float** undef %t8 = bitcast float* %t6 to i8* ; <i8*> [#uses=1] - %t9 = getelementptr inbounds i8* %t8, i64 %t3 ; <i8*> [#uses=1] + %t9 = getelementptr inbounds i8, i8* %t8, i64 %t3 ; <i8*> [#uses=1] store i8 undef, i8* %t9 br label %bb14 } diff --git a/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll b/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll index 005e4c6..a673768 100644 --- a/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll +++ b/test/Transforms/LoopStrengthReduce/use_postinc_value_outside_loop.ll @@ -16,7 +16,7 @@ no_exit.2: ; preds = %no_exit.2, %then.0 %indvar630.ui = phi i32 [ 0, %then.0 ], [ %indvar.next631, %no_exit.2 ] ; <i32> [#uses=3] %indvar630 = bitcast i32 %indvar630.ui to i32 ; <i32> [#uses=2] %gep.upgrd.1 = zext i32 %indvar630.ui to i64 ; <i64> [#uses=1] - %tmp.38 = getelementptr [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] + %tmp.38 = getelementptr [700 x i32], [700 x i32]* %nbeaux_.0__558, i32 0, i64 %gep.upgrd.1 ; <i32*> [#uses=1] store i32 0, i32* %tmp.38 %inc.2 = add i32 %indvar630, 2 ; <i32> [#uses=1] %tmp.34 = call i1 @pred( i32 %indvar630 ) ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll b/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll index 3405b26..2dd14a0 100644 --- a/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll +++ b/test/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll @@ -28,7 +28,7 @@ bb: ; preds = %bb, %bb.preheader %tmp.16 = add i32 %tmp.15, %tmp. ; <i32> [#uses=2] %k_addr.0.0 = bitcast i32 %tmp.16 to i32 ; <i32> [#uses=1] %gep.upgrd.1 = zext i32 %tmp.16 to i64 ; <i64> [#uses=1] - %tmp = getelementptr [8193 x i8]* @flags2, i32 0, i64 %gep.upgrd.1 ; <i8*> [#uses=1] + %tmp = getelementptr [8193 x i8], [8193 x i8]* @flags2, i32 0, i64 %gep.upgrd.1 ; <i8*> [#uses=1] store i8 0, i8* %tmp %k_addr.0 = add i32 %k_addr.0.0, %i.s ; <i32> [#uses=1] %tmp.upgrd.2 = icmp sgt i32 %k_addr.0, 8192 ; <i1> [#uses=1] diff --git a/test/Transforms/LoopStrengthReduce/variable_stride.ll b/test/Transforms/LoopStrengthReduce/variable_stride.ll index 7c0f053..f82b2fc 100644 --- a/test/Transforms/LoopStrengthReduce/variable_stride.ll +++ b/test/Transforms/LoopStrengthReduce/variable_stride.ll @@ -1,6 +1,9 @@ ; Check that variable strides are reduced to adds instead of multiplies. ; RUN: opt < %s -loop-reduce -S | not grep mul +; Provide legal integer types. +target datalayout = "n8:16:32:64" + declare i1 @pred(i32) define void @test([10000 x i32]* %P, i32 %STRIDE) { |