diff options
Diffstat (limited to 'test/Transforms/IndVarSimplify')
62 files changed, 446 insertions, 411 deletions
diff --git a/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll b/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll index ce043be..16ad635 100644 --- a/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll +++ b/test/Transforms/IndVarSimplify/2005-02-17-TruncateExprCrash.ll @@ -45,7 +45,7 @@ then.4: ; preds = %_ZNK7QString2atEi.exit ret void endif.4: ; preds = %_ZNK7QString2atEi.exit - %tmp.115 = load i8* null ; <i8> [#uses=1] + %tmp.115 = load i8, i8* null ; <i8> [#uses=1] br i1 false, label %loopexit.1, label %no_exit.0 no_exit.0: ; preds = %no_exit.0, %endif.4 diff --git a/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll b/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll index 7202c7a..7ef351d 100644 --- a/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll +++ b/test/Transforms/IndVarSimplify/2005-11-18-Crash.ll @@ -7,8 +7,8 @@ entry: br label %no_exit.0 no_exit.0: ; preds = %no_exit.0, %entry - %p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1] - %inc.0 = getelementptr i32* %p.0.0, i32 1 ; <i32*> [#uses=1] + %p.0.0 = phi i32* [ getelementptr ([29 x [29 x [2 x i32]]], [29 x [29 x [2 x i32]]]* @fixtab, i32 0, i32 0, i32 0, i32 0), %entry ], [ %inc.0, %no_exit.0 ] ; <i32*> [#uses=1] + %inc.0 = getelementptr i32, i32* %p.0.0, i32 1 ; <i32*> [#uses=1] br i1 undef, label %no_exit.0, label %no_exit.1 no_exit.1: ; preds = %no_exit.0 diff --git a/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll b/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll index 36ec2b8..2d40f88 100644 --- a/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll +++ b/test/Transforms/IndVarSimplify/2006-06-16-Indvar-LCSSA-Crash.ll @@ -6,9 +6,9 @@ endif.0: no_exit.30: ; preds = %no_exit.30, %endif.0 %x.12.0 = phi i32 [ %inc.28, %no_exit.30 ], [ -2, %endif.0 ] ; <i32> [#uses=1] - %tmp.583 = load i16* null ; <i16> [#uses=1] + %tmp.583 = load i16, i16* null ; <i16> [#uses=1] %tmp.584 = zext i16 %tmp.583 to i32 ; <i32> [#uses=1] - %tmp.588 = load i32* null ; <i32> [#uses=1] + %tmp.588 = load i32, i32* null ; <i32> [#uses=1] %tmp.589 = mul i32 %tmp.584, %tmp.588 ; <i32> [#uses=1] %tmp.591 = add i32 %tmp.589, 0 ; <i32> [#uses=1] %inc.28 = add i32 %x.12.0, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll b/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll index 6366c8c..3dda657 100644 --- a/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll +++ b/test/Transforms/IndVarSimplify/2007-01-06-TripCount.ll @@ -24,8 +24,8 @@ cond_true: ; preds = %bb2 br label %bb cond_next: ; preds = %bb2 - %tmp2 = getelementptr [5 x i8]* @foo, i32 0, i32 %i.0 ; <i8*> [#uses=1] - %tmp3 = load i8* %tmp2 ; <i8> [#uses=1] + %tmp2 = getelementptr [5 x i8], [5 x i8]* @foo, i32 0, i32 %i.0 ; <i8*> [#uses=1] + %tmp3 = load i8, i8* %tmp2 ; <i8> [#uses=1] %tmp5 = icmp eq i8 %tmp3, 0 ; <i1> [#uses=1] br i1 %tmp5, label %bb6, label %bb diff --git a/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll b/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll index a004831..58934f5 100644 --- a/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll +++ b/test/Transforms/IndVarSimplify/2008-09-02-IVType.ll @@ -1,6 +1,10 @@ ; RUN: opt < %s -indvars -S | grep sext | count 1 ; ModuleID = '<stdin>' +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + %struct.App1Marker = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }> %struct.ComponentInstanceRecord = type <{ [1 x i32] }> %struct.DCPredictors = type { [5 x i16] } @@ -18,18 +22,18 @@ define signext i16 @ExtractBufferedBlocksIgnored(%struct.JPEGGlobals* %globp) nounwind { entry: - %tmp4311 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 70 ; <i32*> [#uses=1] - %tmp4412 = load i32* %tmp4311, align 16 ; <i32> [#uses=2] + %tmp4311 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 70 ; <i32*> [#uses=1] + %tmp4412 = load i32, i32* %tmp4311, align 16 ; <i32> [#uses=2] %tmp4613 = icmp sgt i32 %tmp4412, 0 ; <i1> [#uses=1] br i1 %tmp4613, label %bb, label %bb49 bb: ; preds = %bb28, %entry %component.09 = phi i16 [ 0, %entry ], [ %tmp37, %bb28 ] ; <i16> [#uses=2] %tmp12 = sext i16 %component.09 to i32 ; <i32> [#uses=2] - %tmp6 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 77, i32 %tmp12 ; <i16**> [#uses=2] - %tmp7 = load i16** %tmp6, align 4 ; <i16*> [#uses=2] - %tmp235 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 71, i32 %tmp12 ; <i32*> [#uses=1] - %tmp246 = load i32* %tmp235, align 4 ; <i32> [#uses=2] + %tmp6 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 77, i32 %tmp12 ; <i16**> [#uses=2] + %tmp7 = load i16*, i16** %tmp6, align 4 ; <i16*> [#uses=2] + %tmp235 = getelementptr %struct.JPEGGlobals, %struct.JPEGGlobals* %globp, i32 0, i32 71, i32 %tmp12 ; <i32*> [#uses=1] + %tmp246 = load i32, i32* %tmp235, align 4 ; <i32> [#uses=2] %tmp267 = icmp sgt i32 %tmp246, 0 ; <i1> [#uses=1] br i1 %tmp267, label %bb8, label %bb28 @@ -37,7 +41,7 @@ bb8: ; preds = %bb8, %bb %indvar = phi i32 [ 0, %bb ], [ %indvar.next2, %bb8 ] ; <i32> [#uses=3] %theDCTBufferIter.01.rec = shl i32 %indvar, 6 ; <i32> [#uses=1] %tmp10.rec = add i32 %theDCTBufferIter.01.rec, 64 ; <i32> [#uses=1] - %tmp10 = getelementptr i16* %tmp7, i32 %tmp10.rec ; <i16*> [#uses=1] + %tmp10 = getelementptr i16, i16* %tmp7, i32 %tmp10.rec ; <i16*> [#uses=1] %i.02 = trunc i32 %indvar to i16 ; <i16> [#uses=1] %tmp13 = add i16 %i.02, 1 ; <i16> [#uses=1] %phitmp = sext i16 %tmp13 to i32 ; <i32> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll b/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll index 23e7884..1248154 100644 --- a/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll +++ b/test/Transforms/IndVarSimplify/2008-10-03-CouldNotCompute.ll @@ -8,7 +8,7 @@ entry: br i1 false, label %bb.nph, label %return bb.nph: ; preds = %entry - %0 = load i32* @foo, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* @foo, align 4 ; <i32> [#uses=1] %1 = sext i32 %0 to i64 ; <i64> [#uses=1] br label %bb diff --git a/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll b/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll index b461566..ab2af32 100644 --- a/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll +++ b/test/Transforms/IndVarSimplify/2009-04-14-shorten_iv_vars.ll @@ -15,95 +15,95 @@ bb1.thread: bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %84, %bb1 ] ; <i32> [#uses=19] - %0 = load i32** @a, align 8 ; <i32*> [#uses=1] - %1 = load i32** @b, align 8 ; <i32*> [#uses=1] + %0 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] + %1 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %2 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %3 = getelementptr i32* %1, i64 %2 ; <i32*> [#uses=1] - %4 = load i32* %3, align 1 ; <i32> [#uses=1] - %5 = load i32** @c, align 8 ; <i32*> [#uses=1] + %3 = getelementptr i32, i32* %1, i64 %2 ; <i32*> [#uses=1] + %4 = load i32, i32* %3, align 1 ; <i32> [#uses=1] + %5 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %6 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %7 = getelementptr i32* %5, i64 %6 ; <i32*> [#uses=1] - %8 = load i32* %7, align 1 ; <i32> [#uses=1] + %7 = getelementptr i32, i32* %5, i64 %6 ; <i32*> [#uses=1] + %8 = load i32, i32* %7, align 1 ; <i32> [#uses=1] %9 = add i32 %8, %4 ; <i32> [#uses=1] %10 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %11 = getelementptr i32* %0, i64 %10 ; <i32*> [#uses=1] + %11 = getelementptr i32, i32* %0, i64 %10 ; <i32*> [#uses=1] store i32 %9, i32* %11, align 1 - %12 = load i32** @a, align 8 ; <i32*> [#uses=1] + %12 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %13 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] - %14 = load i32** @b, align 8 ; <i32*> [#uses=1] + %14 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %15 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %16 = sext i32 %15 to i64 ; <i64> [#uses=1] - %17 = getelementptr i32* %14, i64 %16 ; <i32*> [#uses=1] - %18 = load i32* %17, align 1 ; <i32> [#uses=1] - %19 = load i32** @c, align 8 ; <i32*> [#uses=1] + %17 = getelementptr i32, i32* %14, i64 %16 ; <i32*> [#uses=1] + %18 = load i32, i32* %17, align 1 ; <i32> [#uses=1] + %19 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %20 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %21 = sext i32 %20 to i64 ; <i64> [#uses=1] - %22 = getelementptr i32* %19, i64 %21 ; <i32*> [#uses=1] - %23 = load i32* %22, align 1 ; <i32> [#uses=1] + %22 = getelementptr i32, i32* %19, i64 %21 ; <i32*> [#uses=1] + %23 = load i32, i32* %22, align 1 ; <i32> [#uses=1] %24 = add i32 %23, %18 ; <i32> [#uses=1] %25 = sext i32 %13 to i64 ; <i64> [#uses=1] - %26 = getelementptr i32* %12, i64 %25 ; <i32*> [#uses=1] + %26 = getelementptr i32, i32* %12, i64 %25 ; <i32*> [#uses=1] store i32 %24, i32* %26, align 1 - %27 = load i32** @a, align 8 ; <i32*> [#uses=1] + %27 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %28 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] - %29 = load i32** @b, align 8 ; <i32*> [#uses=1] + %29 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %30 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %31 = sext i32 %30 to i64 ; <i64> [#uses=1] - %32 = getelementptr i32* %29, i64 %31 ; <i32*> [#uses=1] - %33 = load i32* %32, align 1 ; <i32> [#uses=1] - %34 = load i32** @c, align 8 ; <i32*> [#uses=1] + %32 = getelementptr i32, i32* %29, i64 %31 ; <i32*> [#uses=1] + %33 = load i32, i32* %32, align 1 ; <i32> [#uses=1] + %34 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %35 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %36 = sext i32 %35 to i64 ; <i64> [#uses=1] - %37 = getelementptr i32* %34, i64 %36 ; <i32*> [#uses=1] - %38 = load i32* %37, align 1 ; <i32> [#uses=1] + %37 = getelementptr i32, i32* %34, i64 %36 ; <i32*> [#uses=1] + %38 = load i32, i32* %37, align 1 ; <i32> [#uses=1] %39 = add i32 %38, %33 ; <i32> [#uses=1] %40 = sext i32 %28 to i64 ; <i64> [#uses=1] - %41 = getelementptr i32* %27, i64 %40 ; <i32*> [#uses=1] + %41 = getelementptr i32, i32* %27, i64 %40 ; <i32*> [#uses=1] store i32 %39, i32* %41, align 1 - %42 = load i32** @d, align 8 ; <i32*> [#uses=1] - %43 = load i32** @e, align 8 ; <i32*> [#uses=1] + %42 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] + %43 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %44 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %45 = getelementptr i32* %43, i64 %44 ; <i32*> [#uses=1] - %46 = load i32* %45, align 1 ; <i32> [#uses=1] - %47 = load i32** @f, align 8 ; <i32*> [#uses=1] + %45 = getelementptr i32, i32* %43, i64 %44 ; <i32*> [#uses=1] + %46 = load i32, i32* %45, align 1 ; <i32> [#uses=1] + %47 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %48 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %49 = getelementptr i32* %47, i64 %48 ; <i32*> [#uses=1] - %50 = load i32* %49, align 1 ; <i32> [#uses=1] + %49 = getelementptr i32, i32* %47, i64 %48 ; <i32*> [#uses=1] + %50 = load i32, i32* %49, align 1 ; <i32> [#uses=1] %51 = add i32 %50, %46 ; <i32> [#uses=1] %52 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %53 = getelementptr i32* %42, i64 %52 ; <i32*> [#uses=1] + %53 = getelementptr i32, i32* %42, i64 %52 ; <i32*> [#uses=1] store i32 %51, i32* %53, align 1 - %54 = load i32** @d, align 8 ; <i32*> [#uses=1] + %54 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %55 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] - %56 = load i32** @e, align 8 ; <i32*> [#uses=1] + %56 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %57 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %58 = sext i32 %57 to i64 ; <i64> [#uses=1] - %59 = getelementptr i32* %56, i64 %58 ; <i32*> [#uses=1] - %60 = load i32* %59, align 1 ; <i32> [#uses=1] - %61 = load i32** @f, align 8 ; <i32*> [#uses=1] + %59 = getelementptr i32, i32* %56, i64 %58 ; <i32*> [#uses=1] + %60 = load i32, i32* %59, align 1 ; <i32> [#uses=1] + %61 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %62 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %63 = sext i32 %62 to i64 ; <i64> [#uses=1] - %64 = getelementptr i32* %61, i64 %63 ; <i32*> [#uses=1] - %65 = load i32* %64, align 1 ; <i32> [#uses=1] + %64 = getelementptr i32, i32* %61, i64 %63 ; <i32*> [#uses=1] + %65 = load i32, i32* %64, align 1 ; <i32> [#uses=1] %66 = add i32 %65, %60 ; <i32> [#uses=1] %67 = sext i32 %55 to i64 ; <i64> [#uses=1] - %68 = getelementptr i32* %54, i64 %67 ; <i32*> [#uses=1] + %68 = getelementptr i32, i32* %54, i64 %67 ; <i32*> [#uses=1] store i32 %66, i32* %68, align 1 - %69 = load i32** @d, align 8 ; <i32*> [#uses=1] + %69 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %70 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] - %71 = load i32** @e, align 8 ; <i32*> [#uses=1] + %71 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %72 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %73 = sext i32 %72 to i64 ; <i64> [#uses=1] - %74 = getelementptr i32* %71, i64 %73 ; <i32*> [#uses=1] - %75 = load i32* %74, align 1 ; <i32> [#uses=1] - %76 = load i32** @f, align 8 ; <i32*> [#uses=1] + %74 = getelementptr i32, i32* %71, i64 %73 ; <i32*> [#uses=1] + %75 = load i32, i32* %74, align 1 ; <i32> [#uses=1] + %76 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %77 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %78 = sext i32 %77 to i64 ; <i64> [#uses=1] - %79 = getelementptr i32* %76, i64 %78 ; <i32*> [#uses=1] - %80 = load i32* %79, align 1 ; <i32> [#uses=1] + %79 = getelementptr i32, i32* %76, i64 %78 ; <i32*> [#uses=1] + %80 = load i32, i32* %79, align 1 ; <i32> [#uses=1] %81 = add i32 %80, %75 ; <i32> [#uses=1] %82 = sext i32 %70 to i64 ; <i64> [#uses=1] - %83 = getelementptr i32* %69, i64 %82 ; <i32*> [#uses=1] + %83 = getelementptr i32, i32* %69, i64 %82 ; <i32*> [#uses=1] store i32 %81, i32* %83, align 1 %84 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] %85 = icmp sgt i32 %84, 23646 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll b/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll index 0722d89..921a393 100644 --- a/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll +++ b/test/Transforms/IndVarSimplify/2009-04-15-shorten-iv-vars-2.ll @@ -29,127 +29,127 @@ bb1.thread: bb1: ; preds = %bb1, %bb1.thread %i.0.reg2mem.0 = phi i32 [ 0, %bb1.thread ], [ %116, %bb1 ] ; <i32> [#uses=22] - %0 = load i32** @a, align 8 ; <i32*> [#uses=1] + %0 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %1 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] - %2 = load i32** @b, align 8 ; <i32*> [#uses=1] + %2 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %3 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %4 = zext i32 %3 to i64 ; <i64> [#uses=1] - %5 = getelementptr i32* %2, i64 %4 ; <i32*> [#uses=1] - %6 = load i32* %5, align 1 ; <i32> [#uses=1] - %7 = load i32** @c, align 8 ; <i32*> [#uses=1] + %5 = getelementptr i32, i32* %2, i64 %4 ; <i32*> [#uses=1] + %6 = load i32, i32* %5, align 1 ; <i32> [#uses=1] + %7 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %8 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %9 = zext i32 %8 to i64 ; <i64> [#uses=1] - %10 = getelementptr i32* %7, i64 %9 ; <i32*> [#uses=1] - %11 = load i32* %10, align 1 ; <i32> [#uses=1] + %10 = getelementptr i32, i32* %7, i64 %9 ; <i32*> [#uses=1] + %11 = load i32, i32* %10, align 1 ; <i32> [#uses=1] %12 = add i32 %11, %6 ; <i32> [#uses=1] %13 = zext i32 %1 to i64 ; <i64> [#uses=1] - %14 = getelementptr i32* %0, i64 %13 ; <i32*> [#uses=1] + %14 = getelementptr i32, i32* %0, i64 %13 ; <i32*> [#uses=1] store i32 %12, i32* %14, align 1 - %15 = load i32** @a, align 8 ; <i32*> [#uses=1] + %15 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %16 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %17 = and i32 %16, 15 ; <i32> [#uses=1] - %18 = load i32** @b, align 8 ; <i32*> [#uses=1] + %18 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %19 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %20 = and i32 %19, 15 ; <i32> [#uses=1] %21 = zext i32 %20 to i64 ; <i64> [#uses=1] - %22 = getelementptr i32* %18, i64 %21 ; <i32*> [#uses=1] - %23 = load i32* %22, align 1 ; <i32> [#uses=1] - %24 = load i32** @c, align 8 ; <i32*> [#uses=1] + %22 = getelementptr i32, i32* %18, i64 %21 ; <i32*> [#uses=1] + %23 = load i32, i32* %22, align 1 ; <i32> [#uses=1] + %24 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %25 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %26 = and i32 %25, 15 ; <i32> [#uses=1] %27 = zext i32 %26 to i64 ; <i64> [#uses=1] - %28 = getelementptr i32* %24, i64 %27 ; <i32*> [#uses=1] - %29 = load i32* %28, align 1 ; <i32> [#uses=1] + %28 = getelementptr i32, i32* %24, i64 %27 ; <i32*> [#uses=1] + %29 = load i32, i32* %28, align 1 ; <i32> [#uses=1] %30 = add i32 %29, %23 ; <i32> [#uses=1] %31 = zext i32 %17 to i64 ; <i64> [#uses=1] - %32 = getelementptr i32* %15, i64 %31 ; <i32*> [#uses=1] + %32 = getelementptr i32, i32* %15, i64 %31 ; <i32*> [#uses=1] store i32 %30, i32* %32, align 1 - %33 = load i32** @a, align 8 ; <i32*> [#uses=1] + %33 = load i32*, i32** @a, align 8 ; <i32*> [#uses=1] %34 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %35 = and i32 %34, 15 ; <i32> [#uses=1] - %36 = load i32** @b, align 8 ; <i32*> [#uses=1] + %36 = load i32*, i32** @b, align 8 ; <i32*> [#uses=1] %37 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %38 = and i32 %37, 15 ; <i32> [#uses=1] %39 = zext i32 %38 to i64 ; <i64> [#uses=1] - %40 = getelementptr i32* %36, i64 %39 ; <i32*> [#uses=1] - %41 = load i32* %40, align 1 ; <i32> [#uses=1] - %42 = load i32** @c, align 8 ; <i32*> [#uses=1] + %40 = getelementptr i32, i32* %36, i64 %39 ; <i32*> [#uses=1] + %41 = load i32, i32* %40, align 1 ; <i32> [#uses=1] + %42 = load i32*, i32** @c, align 8 ; <i32*> [#uses=1] %43 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %44 = and i32 %43, 15 ; <i32> [#uses=1] %45 = zext i32 %44 to i64 ; <i64> [#uses=1] - %46 = getelementptr i32* %42, i64 %45 ; <i32*> [#uses=1] - %47 = load i32* %46, align 1 ; <i32> [#uses=1] + %46 = getelementptr i32, i32* %42, i64 %45 ; <i32*> [#uses=1] + %47 = load i32, i32* %46, align 1 ; <i32> [#uses=1] %48 = add i32 %47, %41 ; <i32> [#uses=1] %49 = zext i32 %35 to i64 ; <i64> [#uses=1] - %50 = getelementptr i32* %33, i64 %49 ; <i32*> [#uses=1] + %50 = getelementptr i32, i32* %33, i64 %49 ; <i32*> [#uses=1] store i32 %48, i32* %50, align 1 - %51 = load i32** @d, align 8 ; <i32*> [#uses=1] + %51 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %52 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] - %53 = load i32** @e, align 8 ; <i32*> [#uses=1] + %53 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %54 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %55 = zext i32 %54 to i64 ; <i64> [#uses=1] - %56 = getelementptr i32* %53, i64 %55 ; <i32*> [#uses=1] - %57 = load i32* %56, align 1 ; <i32> [#uses=1] - %58 = load i32** @f, align 8 ; <i32*> [#uses=1] + %56 = getelementptr i32, i32* %53, i64 %55 ; <i32*> [#uses=1] + %57 = load i32, i32* %56, align 1 ; <i32> [#uses=1] + %58 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %59 = and i32 %i.0.reg2mem.0, 15 ; <i32> [#uses=1] %60 = zext i32 %59 to i64 ; <i64> [#uses=1] - %61 = getelementptr i32* %58, i64 %60 ; <i32*> [#uses=1] - %62 = load i32* %61, align 1 ; <i32> [#uses=1] + %61 = getelementptr i32, i32* %58, i64 %60 ; <i32*> [#uses=1] + %62 = load i32, i32* %61, align 1 ; <i32> [#uses=1] %63 = sext i32 %i.0.reg2mem.0 to i64 ; <i64> [#uses=1] - %64 = getelementptr [256 x i32]* @K, i64 0, i64 %63 ; <i32*> [#uses=1] - %65 = load i32* %64, align 4 ; <i32> [#uses=1] + %64 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %63 ; <i32*> [#uses=1] + %65 = load i32, i32* %64, align 4 ; <i32> [#uses=1] %66 = add i32 %62, %57 ; <i32> [#uses=1] %67 = add i32 %66, %65 ; <i32> [#uses=1] %68 = zext i32 %52 to i64 ; <i64> [#uses=1] - %69 = getelementptr i32* %51, i64 %68 ; <i32*> [#uses=1] + %69 = getelementptr i32, i32* %51, i64 %68 ; <i32*> [#uses=1] store i32 %67, i32* %69, align 1 - %70 = load i32** @d, align 8 ; <i32*> [#uses=1] + %70 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %71 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %72 = and i32 %71, 15 ; <i32> [#uses=1] - %73 = load i32** @e, align 8 ; <i32*> [#uses=1] + %73 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %74 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %75 = and i32 %74, 15 ; <i32> [#uses=1] %76 = zext i32 %75 to i64 ; <i64> [#uses=1] - %77 = getelementptr i32* %73, i64 %76 ; <i32*> [#uses=1] - %78 = load i32* %77, align 1 ; <i32> [#uses=1] - %79 = load i32** @f, align 8 ; <i32*> [#uses=1] + %77 = getelementptr i32, i32* %73, i64 %76 ; <i32*> [#uses=1] + %78 = load i32, i32* %77, align 1 ; <i32> [#uses=1] + %79 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %80 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %81 = and i32 %80, 15 ; <i32> [#uses=1] %82 = zext i32 %81 to i64 ; <i64> [#uses=1] - %83 = getelementptr i32* %79, i64 %82 ; <i32*> [#uses=1] - %84 = load i32* %83, align 1 ; <i32> [#uses=1] + %83 = getelementptr i32, i32* %79, i64 %82 ; <i32*> [#uses=1] + %84 = load i32, i32* %83, align 1 ; <i32> [#uses=1] %85 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=1] %86 = sext i32 %85 to i64 ; <i64> [#uses=1] - %87 = getelementptr [256 x i32]* @K, i64 0, i64 %86 ; <i32*> [#uses=1] - %88 = load i32* %87, align 4 ; <i32> [#uses=1] + %87 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %86 ; <i32*> [#uses=1] + %88 = load i32, i32* %87, align 4 ; <i32> [#uses=1] %89 = add i32 %84, %78 ; <i32> [#uses=1] %90 = add i32 %89, %88 ; <i32> [#uses=1] %91 = zext i32 %72 to i64 ; <i64> [#uses=1] - %92 = getelementptr i32* %70, i64 %91 ; <i32*> [#uses=1] + %92 = getelementptr i32, i32* %70, i64 %91 ; <i32*> [#uses=1] store i32 %90, i32* %92, align 1 - %93 = load i32** @d, align 8 ; <i32*> [#uses=1] + %93 = load i32*, i32** @d, align 8 ; <i32*> [#uses=1] %94 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %95 = and i32 %94, 15 ; <i32> [#uses=1] - %96 = load i32** @e, align 8 ; <i32*> [#uses=1] + %96 = load i32*, i32** @e, align 8 ; <i32*> [#uses=1] %97 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %98 = and i32 %97, 15 ; <i32> [#uses=1] %99 = zext i32 %98 to i64 ; <i64> [#uses=1] - %100 = getelementptr i32* %96, i64 %99 ; <i32*> [#uses=1] - %101 = load i32* %100, align 1 ; <i32> [#uses=1] - %102 = load i32** @f, align 8 ; <i32*> [#uses=1] + %100 = getelementptr i32, i32* %96, i64 %99 ; <i32*> [#uses=1] + %101 = load i32, i32* %100, align 1 ; <i32> [#uses=1] + %102 = load i32*, i32** @f, align 8 ; <i32*> [#uses=1] %103 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %104 = and i32 %103, 15 ; <i32> [#uses=1] %105 = zext i32 %104 to i64 ; <i64> [#uses=1] - %106 = getelementptr i32* %102, i64 %105 ; <i32*> [#uses=1] - %107 = load i32* %106, align 1 ; <i32> [#uses=1] + %106 = getelementptr i32, i32* %102, i64 %105 ; <i32*> [#uses=1] + %107 = load i32, i32* %106, align 1 ; <i32> [#uses=1] %108 = add i32 %i.0.reg2mem.0, 2 ; <i32> [#uses=1] %109 = sext i32 %108 to i64 ; <i64> [#uses=1] - %110 = getelementptr [256 x i32]* @K, i64 0, i64 %109 ; <i32*> [#uses=1] - %111 = load i32* %110, align 4 ; <i32> [#uses=1] + %110 = getelementptr [256 x i32], [256 x i32]* @K, i64 0, i64 %109 ; <i32*> [#uses=1] + %111 = load i32, i32* %110, align 4 ; <i32> [#uses=1] %112 = add i32 %107, %101 ; <i32> [#uses=1] %113 = add i32 %112, %111 ; <i32> [#uses=1] %114 = zext i32 %95 to i64 ; <i64> [#uses=1] - %115 = getelementptr i32* %93, i64 %114 ; <i32*> [#uses=1] + %115 = getelementptr i32, i32* %93, i64 %114 ; <i32*> [#uses=1] store i32 %113, i32* %115, align 1 %116 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2] %117 = icmp sgt i32 %116, 23646 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll b/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll index 47164d8..44c43a3 100644 --- a/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll +++ b/test/Transforms/IndVarSimplify/2009-04-27-Floating.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -indvars -S | FileCheck %s ; PR4086 + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + declare void @foo() define void @test() { diff --git a/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll b/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll index 0737489..f0765e7 100644 --- a/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll +++ b/test/Transforms/IndVarSimplify/2011-09-27-hoistsext.ll @@ -17,8 +17,8 @@ for.body: %i2.115 = phi i32 [ 0, %entry ], [ %add249, %for.body ] %add174 = add nsw i32 %i2.115, %x %idxprom177 = sext i32 %add174 to i64 - %arrayidx179 = getelementptr inbounds double* %data, i64 %idxprom177 - %tmp180 = load double* %arrayidx179, align 8 + %arrayidx179 = getelementptr inbounds double, double* %data, i64 %idxprom177 + %tmp180 = load double, double* %arrayidx179, align 8 %add249 = add nsw i32 %i2.115, %y %cmp168 = icmp sgt i32 %add249, %n br i1 %cmp168, label %exit, label %for.body diff --git a/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll b/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll index e462712..3d77a36 100644 --- a/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll +++ b/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll @@ -6,7 +6,7 @@ target triple = "thumbv7-apple-darwin" ; CHECK-LABEL: @test( ; CHECK: if.end.i126: -; CHECK: %exitcond = icmp ne i8* %destYPixelPtr.010.i, getelementptr (i8* null, i32 undef) +; CHECK: %exitcond = icmp ne i8* %incdec.ptr.i, getelementptr (i8, i8* null, i32 undef) define void @test() nounwind { entry: br label %while.cond @@ -40,7 +40,7 @@ if.else.i124: ; preds = %for.body21.i br label %if.end.i126 if.end.i126: ; preds = %if.else.i124, %for.body21.i - %incdec.ptr.i = getelementptr inbounds i8* %destYPixelPtr.010.i, i32 1 + %incdec.ptr.i = getelementptr inbounds i8, i8* %destYPixelPtr.010.i, i32 1 %inc.i125 = add i32 %x.09.i, 1 %cmp19.i = icmp ult i32 %inc.i125, undef br i1 %cmp19.i, label %for.body21.i, label %for.end.i129 diff --git a/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll b/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll index 8247886..a0b1e84 100644 --- a/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll +++ b/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll @@ -25,8 +25,8 @@ preheader: loop: %p.01.us.us = phi i8* [ null, %preheader ], [ %gep, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %cmp = icmp ult i8* %gep, %end br i1 %cmp, label %loop, label %exit @@ -50,8 +50,8 @@ preheader: loop: %p.01.us.us = phi i8* [ %buf, %preheader ], [ %gep, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %cmp = icmp ult i8* %gep, %end br i1 %cmp, label %loop, label %exit @@ -79,8 +79,8 @@ loop: %p.01.us.us = phi i8* [ null, %preheader ], [ %gep, %loop ] %iv = phi i32 [ 0, %preheader ], [ %ivnext, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %ivnext = add i32 %iv, 1 %cmp = icmp ult i32 %ivnext, %cnt br i1 %cmp, label %loop, label %exit @@ -109,8 +109,8 @@ loop: %p.01.us.us = phi i8* [ %buf, %preheader ], [ %gep, %loop ] %iv = phi i32 [ %bi, %preheader ], [ %ivnext, %loop ] %s = phi i8 [0, %preheader], [%snext, %loop] - %gep = getelementptr inbounds i8* %p.01.us.us, i64 1 - %snext = load i8* %gep + %gep = getelementptr inbounds i8, i8* %p.01.us.us, i64 1 + %snext = load i8, i8* %gep %ivnext = add i32 %iv, 1 %cmp = icmp ult i32 %ivnext, %cnt br i1 %cmp, label %loop, label %exit @@ -122,7 +122,7 @@ exit: ; IV and BECount have two different pointer types here. define void @testnullptr([512 x i8]* %base) nounwind { entry: - %add.ptr1603 = getelementptr [512 x i8]* %base, i64 0, i64 512 + %add.ptr1603 = getelementptr [512 x i8], [512 x i8]* %base, i64 0, i64 512 br label %preheader preheader: @@ -131,7 +131,7 @@ preheader: for.body: %r.17193 = phi i8* [ %incdec.ptr1608, %for.body ], [ null, %preheader ] - %incdec.ptr1608 = getelementptr i8* %r.17193, i64 1 + %incdec.ptr1608 = getelementptr i8, i8* %r.17193, i64 1 %cmp1604 = icmp ult i8* %incdec.ptr1608, %add.ptr1603 br i1 %cmp1604, label %for.body, label %for.end1609 diff --git a/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll b/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll index c74d04e..65b2cf6 100644 --- a/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll +++ b/test/Transforms/IndVarSimplify/2011-11-15-multiexit.ll @@ -20,12 +20,12 @@ if.then: ; preds = %entry do.body: ; preds = %if.else, %if.then %firstIV = phi i32* [ %incdec.ptr2, %if.else ], [ %first, %if.then ] - %incdec.ptr1 = getelementptr inbounds i32* %firstIV, i64 1 + %incdec.ptr1 = getelementptr inbounds i32, i32* %firstIV, i64 1 %cmp1 = icmp eq i32* %incdec.ptr1, %last br i1 %cmp1, label %early.exit, label %if.else if.else: ; preds = %do.body - %incdec.ptr2 = getelementptr inbounds i32* %firstIV, i64 2 + %incdec.ptr2 = getelementptr inbounds i32, i32* %firstIV, i64 2 %cmp2 = icmp eq i32* %incdec.ptr2, %last br i1 %cmp2, label %if.end, label %do.body @@ -35,6 +35,6 @@ early.exit: if.end: %tmp = phi i32* [ %first.lcssa, %early.exit ], [ %first, %if.then ], [ %first, %entry ], [ undef, %if.else ] - %val = load i32* %tmp + %val = load i32, i32* %tmp ret i32 %val } diff --git a/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll b/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll index 643d3cb..9fb281f 100644 --- a/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll +++ b/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll @@ -13,7 +13,7 @@ block9: ; preds = %block9,%func_start %undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ] %iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ] %next_iter = add nsw i64 %iter, 1 - %0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef) + %0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef) %next_undef = add nsw i64 %undef, 1 %_tmp_3 = icmp slt i64 %next_iter, 100 br i1 %_tmp_3, label %block9, label %exit diff --git a/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll b/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll index 2c738de..1d80e75 100644 --- a/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll +++ b/test/Transforms/IndVarSimplify/2014-06-21-congruent-constant.ll @@ -13,9 +13,9 @@ entry: br i1 undef, label %for.end12, label %for.cond.preheader for.cond.preheader: ; preds = %entry - %0 = load i32*** @c, align 8 - %1 = load i32** %0, align 8 - %2 = load i32* %1, align 4 + %0 = load i32**, i32*** @c, align 8 + %1 = load i32*, i32** %0, align 8 + %2 = load i32, i32* %1, align 4 br label %for.body for.body: ; preds = %for.cond.backedge, %for.body9.us, %for.cond.preheader @@ -26,7 +26,7 @@ for.body: ; preds = %for.cond.backedge, br i1 %tobool1, label %if.end, label %for.cond.backedge if.end: ; preds = %for.body - %5 = load i32* %3, align 4 + %5 = load i32, i32* %3, align 4 %tobool4 = icmp eq i32 %5, 0 br i1 %tobool4, label %for.cond3, label %for.body9.preheader @@ -35,8 +35,8 @@ for.body9.preheader: ; preds = %if.end br i1 %tobool8, label %for.body9.us, label %for.body9 for.body9.us: ; preds = %for.body9.preheader - %6 = load i32** undef, align 8 - %7 = load i32* %6, align 4 + %6 = load i32*, i32** undef, align 8 + %7 = load i32, i32* %6, align 4 br label %for.body for.cond3: ; preds = %for.cond3, %if.end diff --git a/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll b/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll index 8744b19..ae2cb7f 100644 --- a/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll +++ b/test/Transforms/IndVarSimplify/NVPTX/no-widen-expensive.ll @@ -23,7 +23,7 @@ for.body: ; preds = %for.body.preheader, ; CHECK: phi i32 %mul = mul nsw i32 %i.06, %i.06 %0 = sext i32 %i.06 to i64 - %arrayidx = getelementptr inbounds i32* %output, i64 %0 + %arrayidx = getelementptr inbounds i32, i32* %output, i64 %0 store i32 %mul, i32* %arrayidx, align 4 %add = add nsw i32 %i.06, 3 %cmp = icmp slt i32 %add, %n diff --git a/test/Transforms/IndVarSimplify/ada-loops.ll b/test/Transforms/IndVarSimplify/ada-loops.ll index c093298..e452f03 100644 --- a/test/Transforms/IndVarSimplify/ada-loops.ll +++ b/test/Transforms/IndVarSimplify/ada-loops.ll @@ -18,7 +18,7 @@ target triple = "i686-pc-linux-gnu" define void @kinds__sbytezero([256 x i32]* nocapture %a) nounwind { bb.thread: - %tmp46 = getelementptr [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp46 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %tmp46 br label %bb @@ -27,7 +27,7 @@ bb: ; preds = %bb, %bb.thread %tmp8 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=3] %tmp1 = sext i8 %tmp8 to i32 ; <i32> [#uses=1] %tmp3 = add i32 %tmp1, 128 ; <i32> [#uses=1] - %tmp4 = getelementptr [256 x i32]* %a, i32 0, i32 %tmp3 ; <i32*> [#uses=1] + %tmp4 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 %tmp3 ; <i32*> [#uses=1] store i32 0, i32* %tmp4 %0 = icmp eq i8 %tmp8, 127 ; <i1> [#uses=1] br i1 %0, label %return, label %bb @@ -38,7 +38,7 @@ return: ; preds = %bb define void @kinds__ubytezero([256 x i32]* nocapture %a) nounwind { bb.thread: - %tmp35 = getelementptr [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] + %tmp35 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 0 ; <i32*> [#uses=1] store i32 0, i32* %tmp35 br label %bb @@ -46,7 +46,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ 0, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=1] %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=3] %tmp1 = zext i8 %tmp7 to i32 ; <i32> [#uses=1] - %tmp3 = getelementptr [256 x i32]* %a, i32 0, i32 %tmp1 ; <i32*> [#uses=1] + %tmp3 = getelementptr [256 x i32], [256 x i32]* %a, i32 0, i32 %tmp1 ; <i32*> [#uses=1] store i32 0, i32* %tmp3 %0 = icmp eq i8 %tmp7, -1 ; <i1> [#uses=1] br i1 %0, label %return, label %bb @@ -63,7 +63,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ -10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, 10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 10 ; <i1> [#uses=1] @@ -81,7 +81,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ 10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, -10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 30 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/ashr-tripcount.ll b/test/Transforms/IndVarSimplify/ashr-tripcount.ll index b47c8ad..5f33730 100644 --- a/test/Transforms/IndVarSimplify/ashr-tripcount.ll +++ b/test/Transforms/IndVarSimplify/ashr-tripcount.ll @@ -29,10 +29,10 @@ bb2: ; preds = %bb1, %entry %.pn2.in = and i32 %.pn2.in.in, 3 ; <i32> [#uses=1] %.pn3 = sext i32 %.pn3.in to i64 ; <i64> [#uses=1] %.pn2 = zext i32 %.pn2.in to i64 ; <i64> [#uses=1] - %.pn.in = getelementptr [0 x float]* %pow_2_tab.pn, i64 0, i64 %.pn3 ; <float*> [#uses=1] - %.pn1.in = getelementptr [0 x float]* %pow_2_025_tab.pn, i64 0, i64 %.pn2 ; <float*> [#uses=1] - %.pn = load float* %.pn.in ; <float> [#uses=1] - %.pn1 = load float* %.pn1.in ; <float> [#uses=1] + %.pn.in = getelementptr [0 x float], [0 x float]* %pow_2_tab.pn, i64 0, i64 %.pn3 ; <float*> [#uses=1] + %.pn1.in = getelementptr [0 x float], [0 x float]* %pow_2_025_tab.pn, i64 0, i64 %.pn2 ; <float*> [#uses=1] + %.pn = load float, float* %.pn.in ; <float> [#uses=1] + %.pn1 = load float, float* %.pn1.in ; <float> [#uses=1] %invQuantizer.0 = fmul float %.pn, %.pn1 ; <float> [#uses=4] %t3 = ashr i32 %noOfLines, 2 ; <i32> [#uses=1] %t4 = icmp sgt i32 %t3, 0 ; <i1> [#uses=1] @@ -46,50 +46,50 @@ bb3: ; preds = %bb4, %bb.nph %i.05 = phi i32 [ %t49, %bb4 ], [ 0, %bb.nph ] ; <i32> [#uses=9] %k.04 = phi i32 [ %t48, %bb4 ], [ 0, %bb.nph ] ; <i32> [#uses=1] %t6 = sext i32 %i.05 to i64 ; <i64> [#uses=1] - %t7 = getelementptr i32* %quaSpectrum, i64 %t6 ; <i32*> [#uses=1] - %t8 = load i32* %t7, align 4 ; <i32> [#uses=1] + %t7 = getelementptr i32, i32* %quaSpectrum, i64 %t6 ; <i32*> [#uses=1] + %t8 = load i32, i32* %t7, align 4 ; <i32> [#uses=1] %t9 = zext i32 %t8 to i64 ; <i64> [#uses=1] - %t10 = getelementptr float* %pow4_3_tab_ptr, i64 %t9 ; <float*> [#uses=1] - %t11 = load float* %t10, align 4 ; <float> [#uses=1] + %t10 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t9 ; <float*> [#uses=1] + %t11 = load float, float* %t10, align 4 ; <float> [#uses=1] %t12 = or i32 %i.05, 1 ; <i32> [#uses=1] %t13 = sext i32 %t12 to i64 ; <i64> [#uses=1] - %t14 = getelementptr i32* %quaSpectrum, i64 %t13 ; <i32*> [#uses=1] - %t15 = load i32* %t14, align 4 ; <i32> [#uses=1] + %t14 = getelementptr i32, i32* %quaSpectrum, i64 %t13 ; <i32*> [#uses=1] + %t15 = load i32, i32* %t14, align 4 ; <i32> [#uses=1] %t16 = zext i32 %t15 to i64 ; <i64> [#uses=1] - %t17 = getelementptr float* %pow4_3_tab_ptr, i64 %t16 ; <float*> [#uses=1] - %t18 = load float* %t17, align 4 ; <float> [#uses=1] + %t17 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t16 ; <float*> [#uses=1] + %t18 = load float, float* %t17, align 4 ; <float> [#uses=1] %t19 = or i32 %i.05, 2 ; <i32> [#uses=1] %t20 = sext i32 %t19 to i64 ; <i64> [#uses=1] - %t21 = getelementptr i32* %quaSpectrum, i64 %t20 ; <i32*> [#uses=1] - %t22 = load i32* %t21, align 4 ; <i32> [#uses=1] + %t21 = getelementptr i32, i32* %quaSpectrum, i64 %t20 ; <i32*> [#uses=1] + %t22 = load i32, i32* %t21, align 4 ; <i32> [#uses=1] %t23 = zext i32 %t22 to i64 ; <i64> [#uses=1] - %t24 = getelementptr float* %pow4_3_tab_ptr, i64 %t23 ; <float*> [#uses=1] - %t25 = load float* %t24, align 4 ; <float> [#uses=1] + %t24 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t23 ; <float*> [#uses=1] + %t25 = load float, float* %t24, align 4 ; <float> [#uses=1] %t26 = or i32 %i.05, 3 ; <i32> [#uses=1] %t27 = sext i32 %t26 to i64 ; <i64> [#uses=1] - %t28 = getelementptr i32* %quaSpectrum, i64 %t27 ; <i32*> [#uses=1] - %t29 = load i32* %t28, align 4 ; <i32> [#uses=1] + %t28 = getelementptr i32, i32* %quaSpectrum, i64 %t27 ; <i32*> [#uses=1] + %t29 = load i32, i32* %t28, align 4 ; <i32> [#uses=1] %t30 = zext i32 %t29 to i64 ; <i64> [#uses=1] - %t31 = getelementptr float* %pow4_3_tab_ptr, i64 %t30 ; <float*> [#uses=1] - %t32 = load float* %t31, align 4 ; <float> [#uses=1] + %t31 = getelementptr float, float* %pow4_3_tab_ptr, i64 %t30 ; <float*> [#uses=1] + %t32 = load float, float* %t31, align 4 ; <float> [#uses=1] %t33 = fmul float %t11, %invQuantizer.0 ; <float> [#uses=1] %t34 = sext i32 %i.05 to i64 ; <i64> [#uses=1] - %t35 = getelementptr float* %iquaSpectrum, i64 %t34 ; <float*> [#uses=1] + %t35 = getelementptr float, float* %iquaSpectrum, i64 %t34 ; <float*> [#uses=1] store float %t33, float* %t35, align 4 %t36 = or i32 %i.05, 1 ; <i32> [#uses=1] %t37 = fmul float %t18, %invQuantizer.0 ; <float> [#uses=1] %t38 = sext i32 %t36 to i64 ; <i64> [#uses=1] - %t39 = getelementptr float* %iquaSpectrum, i64 %t38 ; <float*> [#uses=1] + %t39 = getelementptr float, float* %iquaSpectrum, i64 %t38 ; <float*> [#uses=1] store float %t37, float* %t39, align 4 %t40 = or i32 %i.05, 2 ; <i32> [#uses=1] %t41 = fmul float %t25, %invQuantizer.0 ; <float> [#uses=1] %t42 = sext i32 %t40 to i64 ; <i64> [#uses=1] - %t43 = getelementptr float* %iquaSpectrum, i64 %t42 ; <float*> [#uses=1] + %t43 = getelementptr float, float* %iquaSpectrum, i64 %t42 ; <float*> [#uses=1] store float %t41, float* %t43, align 4 %t44 = or i32 %i.05, 3 ; <i32> [#uses=1] %t45 = fmul float %t32, %invQuantizer.0 ; <float> [#uses=1] %t46 = sext i32 %t44 to i64 ; <i64> [#uses=1] - %t47 = getelementptr float* %iquaSpectrum, i64 %t46 ; <float*> [#uses=1] + %t47 = getelementptr float, float* %iquaSpectrum, i64 %t46 ; <float*> [#uses=1] store float %t45, float* %t47, align 4 %t48 = add i32 %k.04, 1 ; <i32> [#uses=2] %t49 = add i32 %i.05, 4 ; <i32> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/avoid-i0.ll b/test/Transforms/IndVarSimplify/avoid-i0.ll index 22f2e4b..cc38590 100644 --- a/test/Transforms/IndVarSimplify/avoid-i0.ll +++ b/test/Transforms/IndVarSimplify/avoid-i0.ll @@ -34,25 +34,25 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %_si1, i32* %_si1_addr store i8 %_si2, i8* %_si2_addr - %1 = load i8* %_si2_addr, align 1 ; <i8> [#uses=1] + %1 = load i8, i8* %_si2_addr, align 1 ; <i8> [#uses=1] %2 = sext i8 %1 to i32 ; <i32> [#uses=1] - %3 = load i32* %_si1_addr, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* %_si1_addr, align 4 ; <i32> [#uses=1] %4 = xor i32 %2, %3 ; <i32> [#uses=1] - %5 = load i8* %_si2_addr, align 1 ; <i8> [#uses=1] + %5 = load i8, i8* %_si2_addr, align 1 ; <i8> [#uses=1] %6 = sext i8 %5 to i32 ; <i32> [#uses=1] %7 = sub i32 7, %6 ; <i32> [#uses=1] - %8 = load i32* %_si1_addr, align 4 ; <i32> [#uses=1] + %8 = load i32, i32* %_si1_addr, align 4 ; <i32> [#uses=1] %9 = shl i32 %8, %7 ; <i32> [#uses=1] %10 = and i32 %4, %9 ; <i32> [#uses=1] %11 = icmp slt i32 %10, 0 ; <i1> [#uses=1] %12 = zext i1 %11 to i32 ; <i32> [#uses=1] store i32 %12, i32* %0, align 4 - %13 = load i32* %0, align 4 ; <i32> [#uses=1] + %13 = load i32, i32* %0, align 4 ; <i32> [#uses=1] store i32 %13, i32* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load i32* %retval ; <i32> [#uses=1] + %retval1 = load i32, i32* %retval ; <i32> [#uses=1] %retval12 = trunc i32 %retval1 to i8 ; <i8> [#uses=1] ret i8 %retval12 } @@ -66,15 +66,15 @@ entry: %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %_ui1, i32* %_ui1_addr store i32 %_ui2, i32* %_ui2_addr - %1 = load i32* %_ui1_addr, align 4 ; <i32> [#uses=1] + %1 = load i32, i32* %_ui1_addr, align 4 ; <i32> [#uses=1] %2 = sub i32 %1, 1 ; <i32> [#uses=1] store i32 %2, i32* %0, align 4 - %3 = load i32* %0, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* %0, align 4 ; <i32> [#uses=1] store i32 %3, i32* %retval, align 4 br label %return return: ; preds = %entry - %retval1 = load i32* %retval ; <i32> [#uses=1] + %retval1 = load i32, i32* %retval ; <i32> [#uses=1] ret i32 %retval1 } @@ -90,31 +90,31 @@ entry: br label %bb4 bb: ; preds = %bb4 - %0 = load volatile i32* @x, align 4 ; <i32> [#uses=1] + %0 = load volatile i32, i32* @x, align 4 ; <i32> [#uses=1] store i32 %0, i32* %vol.0, align 4 store i32 0, i32* %l_52, align 4 br label %bb2 bb1: ; preds = %bb2 - %1 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %1 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %2 = call i32 @safe_sub_func_uint64_t_u_u(i32 %1, i32 1) nounwind ; <i32> [#uses=1] store i32 %2, i32* %l_52, align 4 br label %bb2 bb2: ; preds = %bb1, %bb - %3 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %3 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %4 = icmp eq i32 %3, 0 ; <i1> [#uses=1] br i1 %4, label %bb1, label %bb3 bb3: ; preds = %bb2 - %5 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %5 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %6 = call signext i8 @safe_sub_func_int32_t_s_s(i32 %5, i8 signext 1) nounwind ; <i8> [#uses=1] %7 = sext i8 %6 to i32 ; <i32> [#uses=1] store i32 %7, i32* %l_52, align 4 br label %bb4 bb4: ; preds = %bb3, %entry - %8 = load i32* %l_52, align 4 ; <i32> [#uses=1] + %8 = load i32, i32* %l_52, align 4 ; <i32> [#uses=1] %9 = icmp ne i32 %8, 0 ; <i1> [#uses=1] br i1 %9, label %bb, label %bb5 diff --git a/test/Transforms/IndVarSimplify/backedge-on-min-max.ll b/test/Transforms/IndVarSimplify/backedge-on-min-max.ll index 250ff9a..bb26ca5 100644 --- a/test/Transforms/IndVarSimplify/backedge-on-min-max.ll +++ b/test/Transforms/IndVarSimplify/backedge-on-min-max.ll @@ -18,7 +18,7 @@ define void @min.signed.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -46,7 +46,7 @@ define void @min.signed.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -74,7 +74,7 @@ define void @min.signed.3(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -102,7 +102,7 @@ define void @min.signed.4(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -130,7 +130,7 @@ define void @max.signed.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -158,7 +158,7 @@ define void @max.signed.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -186,7 +186,7 @@ define void @max.signed.3(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -214,7 +214,7 @@ define void @max.signed.4(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -244,7 +244,7 @@ define void @min.unsigned.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -272,7 +272,7 @@ define void @min.unsigned.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -300,7 +300,7 @@ define void @min.unsigned.3(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -328,7 +328,7 @@ define void @min.unsigned.4(i32* %a, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -356,7 +356,7 @@ define void @max.unsigned.1(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -384,7 +384,7 @@ define void @max.unsigned.2(i32* %a, i32 %a_len, i32 %n) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -412,7 +412,7 @@ define void @max.unsigned.3(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch @@ -440,7 +440,7 @@ define void @max.unsigned.4(i32* %a, i32 %n, i32 %init) { ; CHECK: br i1 true, label %ok, label %latch ok: - %addr = getelementptr i32* %a, i32 %idx + %addr = getelementptr i32, i32* %a, i32 %idx store i32 %idx, i32* %addr br label %latch diff --git a/test/Transforms/IndVarSimplify/casted-argument.ll b/test/Transforms/IndVarSimplify/casted-argument.ll index a5e002b..9d868e8 100644 --- a/test/Transforms/IndVarSimplify/casted-argument.ll +++ b/test/Transforms/IndVarSimplify/casted-argument.ll @@ -17,7 +17,7 @@ loop: ; preds = %loop, %if.else %pn = phi i8* [ %ge, %loop ], [ null, %entry ] ; <i8*> [#uses=1] %cp = ptrtoint i8* %to to i32 ; <i32> [#uses=1] %su = sub i32 0, %cp ; <i32> [#uses=1] - %ge = getelementptr i8* %pn, i32 %su ; <i8*> [#uses=2] + %ge = getelementptr i8, i8* %pn, i32 %su ; <i8*> [#uses=2] tail call void @bcopy(i8* %ge) nounwind br label %loop } @@ -39,9 +39,9 @@ if.end54: ; preds = %if.end54, %if.else %sub.ptr.rhs.cast46.pn = ptrtoint i8* %from to i32 ; <i32> [#uses=1] %sub.ptr.lhs.cast45.pn = ptrtoint i8* %to to i32 ; <i32> [#uses=1] %sub.ptr.sub47.pn = sub i32 %sub.ptr.rhs.cast46.pn, %sub.ptr.lhs.cast45.pn ; <i32> [#uses=1] - %sub.ptr4912 = getelementptr i8* %sub.ptr4912.pn, i32 %sub.ptr.sub47.pn ; <i8*> [#uses=2] + %sub.ptr4912 = getelementptr i8, i8* %sub.ptr4912.pn, i32 %sub.ptr.sub47.pn ; <i8*> [#uses=2] tail call void @bcopy_4038(i8* %sub.ptr4912, i8* %sub.ptr7, i32 0) nounwind - %sub.ptr = getelementptr i8* %sub.ptr7, i32 %sub.ptr.rhs.cast40 ; <i8*> [#uses=1] + %sub.ptr = getelementptr i8, i8* %sub.ptr7, i32 %sub.ptr.rhs.cast40 ; <i8*> [#uses=1] br label %if.end54 } diff --git a/test/Transforms/IndVarSimplify/dangling-use.ll b/test/Transforms/IndVarSimplify/dangling-use.ll index 51c3120..24a68a9 100644 --- a/test/Transforms/IndVarSimplify/dangling-use.ll +++ b/test/Transforms/IndVarSimplify/dangling-use.ll @@ -15,7 +15,7 @@ bb49: ; preds = %bb48, %entry bb10: ; preds = %bb49 %tmp326 = mul nsw i32 %tmp1, %tmp2 ; <i32> [#uses=1] - %tmp351 = getelementptr inbounds i8* %x_addr.0, i32 %tmp326 ; <i8*> [#uses=1] + %tmp351 = getelementptr inbounds i8, i8* %x_addr.0, i32 %tmp326 ; <i8*> [#uses=1] br i1 false, label %bb.nph, label %bb48 bb.nph: ; preds = %bb10 @@ -25,7 +25,7 @@ bb23: ; preds = %bb28, %bb.nph %pOriginHi.01 = phi i8* [ %tmp351, %bb.nph ], [ %pOriginHi.0, %bb28 ] ; <i8*> [#uses=2] %tmp378 = bitcast i8* %pOriginHi.01 to i8* ; <i8*> [#uses=1] store i8* %tmp378, i8** null - %tmp385 = getelementptr inbounds i8* %pOriginHi.01, i32 %tmp2 ; <i8*> [#uses=1] + %tmp385 = getelementptr inbounds i8, i8* %pOriginHi.01, i32 %tmp2 ; <i8*> [#uses=1] br label %bb28 bb28: ; preds = %bb23 @@ -36,6 +36,6 @@ bb28.bb48_crit_edge: ; preds = %bb28 br label %bb48 bb48: ; preds = %bb28.bb48_crit_edge, %bb10 - %tmp481 = getelementptr inbounds i8* %x_addr.0, i32 1 ; <i8*> [#uses=1] + %tmp481 = getelementptr inbounds i8, i8* %x_addr.0, i32 1 ; <i8*> [#uses=1] br label %bb49 } diff --git a/test/Transforms/IndVarSimplify/elim-extend.ll b/test/Transforms/IndVarSimplify/elim-extend.ll index ad5679f..98701c3 100644 --- a/test/Transforms/IndVarSimplify/elim-extend.ll +++ b/test/Transforms/IndVarSimplify/elim-extend.ll @@ -14,15 +14,15 @@ loop: %iv = phi i32 [ %postiv, %loop ], [ 0, %entry ] %ivnsw = phi i32 [ %postivnsw, %loop ], [ 0, %entry ] %preofs = sext i32 %iv to i64 - %preadr = getelementptr i8* %base, i64 %preofs + %preadr = getelementptr i8, i8* %base, i64 %preofs store i8 0, i8* %preadr %postiv = add i32 %iv, 1 %postofs = sext i32 %postiv to i64 - %postadr = getelementptr i8* %base, i64 %postofs + %postadr = getelementptr i8, i8* %base, i64 %postofs store i8 0, i8* %postadr %postivnsw = add nsw i32 %ivnsw, 1 %postofsnsw = sext i32 %postivnsw to i64 - %postadrnsw = getelementptr i8* %base, i64 %postofsnsw + %postadrnsw = getelementptr i8, i8* %base, i64 %postofsnsw store i8 0, i8* %postadrnsw %cond = icmp sgt i32 %limit, %iv br i1 %cond, label %loop, label %exit @@ -46,15 +46,15 @@ loop: %iv = phi i32 [ %postiv, %loop ], [ %init, %entry ] %ivnsw = phi i32 [ %postivnsw, %loop ], [ %init, %entry ] %preofs = sext i32 %iv to i64 - %preadr = getelementptr i8* %base, i64 %preofs + %preadr = getelementptr i8, i8* %base, i64 %preofs store i8 0, i8* %preadr %postiv = add i32 %iv, 1 %postofs = sext i32 %postiv to i64 - %postadr = getelementptr i8* %base, i64 %postofs + %postadr = getelementptr i8, i8* %base, i64 %postofs store i8 0, i8* %postadr %postivnsw = add nsw i32 %ivnsw, 1 %postofsnsw = sext i32 %postivnsw to i64 - %postadrnsw = getelementptr i8* %base, i64 %postofsnsw + %postadrnsw = getelementptr i8, i8* %base, i64 %postofsnsw store i8 0, i8* %postadrnsw %cond = icmp sgt i32 %limit, %postiv br i1 %cond, label %loop, label %exit @@ -88,7 +88,7 @@ outerloop: %outercountdec = add i32 %outercount, -1 %ofs1 = sext i32 %outercountdec to i64 - %adr1 = getelementptr i8* %address, i64 %ofs1 + %adr1 = getelementptr i8, i8* %address, i64 %ofs1 store i8 0, i8* %adr1 br label %innerpreheader @@ -112,11 +112,11 @@ innerloop: %innerpostiv = add i32 %inneriv, 1 %ofs2 = sext i32 %inneriv to i64 - %adr2 = getelementptr i8* %address, i64 %ofs2 + %adr2 = getelementptr i8, i8* %address, i64 %ofs2 store i8 0, i8* %adr2 %ofs3 = sext i32 %innerpostiv to i64 - %adr3 = getelementptr i8* %address, i64 %ofs3 + %adr3 = getelementptr i8, i8* %address, i64 %ofs3 store i8 0, i8* %adr3 %innercmp = icmp sgt i32 %limitdec, %innerpostiv @@ -137,11 +137,11 @@ outermerge: %innercount.merge = phi i32 [ %innercount.lcssa, %innerexit ], [ %innercount, %innerpreheader ] %ofs4 = sext i32 %outercount to i64 - %adr4 = getelementptr i8* %address, i64 %ofs4 + %adr4 = getelementptr i8, i8* %address, i64 %ofs4 store i8 0, i8* %adr4 %ofs5 = sext i32 %innercount.merge to i64 - %adr5 = getelementptr i8* %address, i64 %ofs5 + %adr5 = getelementptr i8, i8* %address, i64 %ofs5 store i8 0, i8* %adr5 %outerpostcount = add i32 %outercount, 1 diff --git a/test/Transforms/IndVarSimplify/eliminate-comparison.ll b/test/Transforms/IndVarSimplify/eliminate-comparison.ll index b48403e..4d14b36 100644 --- a/test/Transforms/IndVarSimplify/eliminate-comparison.ll +++ b/test/Transforms/IndVarSimplify/eliminate-comparison.ll @@ -16,7 +16,7 @@ entry: br i1 %cmp9, label %pre, label %return pre: - %t3 = load i32* %p + %t3 = load i32, i32* %p %tobool.not = icmp ne i32 %t3, 0 br label %loop @@ -27,7 +27,7 @@ loop: br i1 %cond, label %if.then, label %for.inc if.then: - %arrayidx = getelementptr [0 x double]* @X, i64 0, i64 %i + %arrayidx = getelementptr [0 x double], [0 x double]* @X, i64 0, i64 %i store double 3.200000e+00, double* %arrayidx br label %for.inc @@ -50,22 +50,22 @@ entry: br label %bb18 bb13: - %tmp66 = load i64** %tmp65, align 4 - %tmp68 = getelementptr inbounds i64* %tmp66, i32 %i - %tmp69 = load i64* %tmp68, align 4 - %tmp74 = load i64** %tmp73, align 4 - %tmp76 = getelementptr inbounds i64* %tmp74, i32 %i - %tmp77 = load i64* %tmp76, align 4 + %tmp66 = load i64*, i64** %tmp65, align 4 + %tmp68 = getelementptr inbounds i64, i64* %tmp66, i32 %i + %tmp69 = load i64, i64* %tmp68, align 4 + %tmp74 = load i64*, i64** %tmp73, align 4 + %tmp76 = getelementptr inbounds i64, i64* %tmp74, i32 %i + %tmp77 = load i64, i64* %tmp76, align 4 %tmp78 = icmp ugt i64 %tmp69, %tmp77 br i1 %tmp78, label %bb20.loopexit, label %bb15 bb15: - %tmp83 = load i64** %tmp82, align 4 - %tmp85 = getelementptr inbounds i64* %tmp83, i32 %i - %tmp86 = load i64* %tmp85, align 4 - %tmp91 = load i64** %tmp90, align 4 - %tmp93 = getelementptr inbounds i64* %tmp91, i32 %i - %tmp94 = load i64* %tmp93, align 4 + %tmp83 = load i64*, i64** %tmp82, align 4 + %tmp85 = getelementptr inbounds i64, i64* %tmp83, i32 %i + %tmp86 = load i64, i64* %tmp85, align 4 + %tmp91 = load i64*, i64** %tmp90, align 4 + %tmp93 = getelementptr inbounds i64, i64* %tmp91, i32 %i + %tmp94 = load i64, i64* %tmp93, align 4 %tmp95 = icmp ult i64 %tmp86, %tmp94 br i1 %tmp95, label %bb20.loopexit, label %bb17 diff --git a/test/Transforms/IndVarSimplify/eliminate-max.ll b/test/Transforms/IndVarSimplify/eliminate-max.ll index 98510ea..125ed74 100644 --- a/test/Transforms/IndVarSimplify/eliminate-max.ll +++ b/test/Transforms/IndVarSimplify/eliminate-max.ll @@ -45,7 +45,7 @@ bb14: ; preds = %bb11, %bb7 br i1 %t20, label %bb1, label %bb21 bb21: ; preds = %bb14 - %t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind + %t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind ret i32 0 } diff --git a/test/Transforms/IndVarSimplify/eliminate-rem.ll b/test/Transforms/IndVarSimplify/eliminate-rem.ll index 64fe710..6f8e6bb 100644 --- a/test/Transforms/IndVarSimplify/eliminate-rem.ll +++ b/test/Transforms/IndVarSimplify/eliminate-rem.ll @@ -18,7 +18,7 @@ bb4: ; preds = %bb bb5: ; preds = %bb4, %bb5 %t6 = phi i64 [ %t9, %bb5 ], [ 0, %bb4 ] ; <i64> [#uses=2] %t7 = srem i64 %t6, %arg ; <i64> [#uses=1] - %t8 = getelementptr inbounds double* %arg3, i64 %t7 ; <double*> [#uses=1] + %t8 = getelementptr inbounds double, double* %arg3, i64 %t7 ; <double*> [#uses=1] store double 0.000000e+00, double* %t8 %t9 = add nsw i64 %t6, 1 ; <i64> [#uses=2] %t10 = icmp slt i64 %t9, %arg ; <i1> [#uses=1] @@ -78,16 +78,16 @@ bb21: ; preds = %bb21, %bb20 %t26 = add nsw i64 %t24, %t22 ; <i64> [#uses=1] %t27 = mul i64 %t11, %arg1 ; <i64> [#uses=1] %t28 = add nsw i64 %t25, %t22 ; <i64> [#uses=1] - %t29 = getelementptr inbounds i64* %arg, i64 %t26 ; <i64*> [#uses=1] + %t29 = getelementptr inbounds i64, i64* %arg, i64 %t26 ; <i64*> [#uses=1] %t30 = add nsw i64 %t27, %t22 ; <i64> [#uses=1] - %t31 = getelementptr inbounds i64* %arg, i64 %t28 ; <i64*> [#uses=1] + %t31 = getelementptr inbounds i64, i64* %arg, i64 %t28 ; <i64*> [#uses=1] %t32 = zext i32 %t23 to i64 ; <i64> [#uses=1] - %t33 = load i64* %t29 ; <i64> [#uses=1] - %t34 = getelementptr inbounds i64* %arg, i64 %t30 ; <i64*> [#uses=1] - %t35 = load i64* %t31 ; <i64> [#uses=1] + %t33 = load i64, i64* %t29 ; <i64> [#uses=1] + %t34 = getelementptr inbounds i64, i64* %arg, i64 %t30 ; <i64*> [#uses=1] + %t35 = load i64, i64* %t31 ; <i64> [#uses=1] %t36 = add nsw i64 %t32, %t33 ; <i64> [#uses=1] %t37 = add nsw i64 %t36, %t35 ; <i64> [#uses=1] - %t38 = load i64* %t34 ; <i64> [#uses=1] + %t38 = load i64, i64* %t34 ; <i64> [#uses=1] %t39 = add nsw i64 %t37, %t38 ; <i64> [#uses=1] %t40 = trunc i64 %t39 to i32 ; <i32> [#uses=2] %t41 = add nsw i64 %t22, 1 ; <i64> [#uses=2] diff --git a/test/Transforms/IndVarSimplify/indirectbr.ll b/test/Transforms/IndVarSimplify/indirectbr.ll index a208ded..d580169 100644 --- a/test/Transforms/IndVarSimplify/indirectbr.ll +++ b/test/Transforms/IndVarSimplify/indirectbr.ll @@ -32,8 +32,8 @@ bb14: ; preds = %bb14, %bb7.preheade bb16: ; preds = %bb16, %bb14, %bb7.preheader %S.31.0 = phi i64 [ %3, %bb16 ], [ 1, %bb7.preheader ], [ 1, %bb14 ] ; <i64> [#uses=2] %0 = add nsw i64 %S.31.0, -1 ; <i64> [#uses=1] - %1 = getelementptr inbounds [3 x double]* undef, i64 0, i64 %0 ; <double*> [#uses=1] - %2 = load double* %1, align 8 ; <double> [#uses=0] + %1 = getelementptr inbounds [3 x double], [3 x double]* undef, i64 0, i64 %0 ; <double*> [#uses=1] + %2 = load double, double* %1, align 8 ; <double> [#uses=0] %3 = add nsw i64 %S.31.0, 1 ; <i64> [#uses=1] br label %bb16 } diff --git a/test/Transforms/IndVarSimplify/iv-fold.ll b/test/Transforms/IndVarSimplify/iv-fold.ll index 41a1f5f..af8a33b 100644 --- a/test/Transforms/IndVarSimplify/iv-fold.ll +++ b/test/Transforms/IndVarSimplify/iv-fold.ll @@ -13,12 +13,12 @@ entry: while.body: %0 = phi i32 [ 0, %entry ], [ %inc.2, %while.body ] %shr = lshr i32 %0, 5 - %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr - %tmp6 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr + %tmp6 = load i32, i32* %arrayidx, align 4 %inc.1 = add i32 %0, 1 %shr.1 = lshr i32 %inc.1, 5 - %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1 - %tmp6.1 = load i32* %arrayidx.1, align 4 + %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1 + %tmp6.1 = load i32, i32* %arrayidx.1, align 4 %inc.2 = add i32 %inc.1, 1 %exitcond.3 = icmp eq i32 %inc.2, 128 br i1 %exitcond.3, label %while.end, label %while.body @@ -40,12 +40,12 @@ entry: while.body: %0 = phi i32 [ 0, %entry ], [ %inc.3, %while.body ] %shr = lshr i32 %0, 5 - %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr - %tmp6 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %bitmap, i32 %shr + %tmp6 = load i32, i32* %arrayidx, align 4 %inc.1 = add i32 %0, 1 %shr.1 = lshr i32 %inc.1, 5 - %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1 - %tmp6.1 = load i32* %arrayidx.1, align 4 + %arrayidx.1 = getelementptr inbounds i32, i32* %bitmap, i32 %shr.1 + %tmp6.1 = load i32, i32* %arrayidx.1, align 4 %inc.3 = add i32 %inc.1, 2 %exitcond.3 = icmp eq i32 %inc.3, 96 br i1 %exitcond.3, label %while.end, label %while.body diff --git a/test/Transforms/IndVarSimplify/iv-sext.ll b/test/Transforms/IndVarSimplify/iv-sext.ll index 04df0f9..89e21e1 100644 --- a/test/Transforms/IndVarSimplify/iv-sext.ll +++ b/test/Transforms/IndVarSimplify/iv-sext.ll @@ -8,7 +8,7 @@ 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 @t(float* %pTmp1, float* %peakWeight, float* %nrgReducePeakrate, i32 %bandEdgeIndex, float %tmp1) nounwind { entry: - %tmp = load float* %peakWeight, align 4 ; <float> [#uses=1] + %tmp = load float, float* %peakWeight, align 4 ; <float> [#uses=1] %tmp2 = icmp sgt i32 %bandEdgeIndex, 0 ; <i1> [#uses=1] br i1 %tmp2, label %bb.nph22, label %return @@ -33,13 +33,13 @@ bb: ; preds = %bb8, %bb.nph22 bb1: ; preds = %bb %tmp5 = add i32 %part.016, -1 ; <i32> [#uses=1] %tmp6 = sext i32 %tmp5 to i64 ; <i64> [#uses=1] - %tmp7 = getelementptr float* %pTmp1, i64 %tmp6 ; <float*> [#uses=1] - %tmp8 = load float* %tmp7, align 4 ; <float> [#uses=1] + %tmp7 = getelementptr float, float* %pTmp1, i64 %tmp6 ; <float*> [#uses=1] + %tmp8 = load float, float* %tmp7, align 4 ; <float> [#uses=1] %tmp9 = fadd float %tmp8, %distERBlo.120 ; <float> [#uses=1] %tmp10 = add i32 %part.016, -1 ; <i32> [#uses=1] %tmp11 = sext i32 %tmp10 to i64 ; <i64> [#uses=1] - %tmp12 = getelementptr float* %pTmp1, i64 %tmp11 ; <float*> [#uses=1] - %tmp13 = load float* %tmp12, align 4 ; <float> [#uses=1] + %tmp12 = getelementptr float, float* %pTmp1, i64 %tmp11 ; <float*> [#uses=1] + %tmp13 = load float, float* %tmp12, align 4 ; <float> [#uses=1] %tmp14 = fsub float %distERBhi.121, %tmp13 ; <float> [#uses=1] br label %bb3.preheader @@ -57,12 +57,12 @@ bb2: ; preds = %bb3, %bb.nph %loPart.02 = phi i32 [ %tmp24, %bb3 ], [ %loPart.118, %bb.nph ] ; <i32> [#uses=3] %peakCount.01 = phi float [ %tmp23, %bb3 ], [ %peakCount.117, %bb.nph ] ; <float> [#uses=1] %tmp16 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1] - %tmp17 = getelementptr float* %pTmp1, i64 %tmp16 ; <float*> [#uses=1] - %tmp18 = load float* %tmp17, align 4 ; <float> [#uses=1] + %tmp17 = getelementptr float, float* %pTmp1, i64 %tmp16 ; <float*> [#uses=1] + %tmp18 = load float, float* %tmp17, align 4 ; <float> [#uses=1] %tmp19 = fsub float %distERBlo.03, %tmp18 ; <float> [#uses=3] %tmp20 = sext i32 %loPart.02 to i64 ; <i64> [#uses=1] - %tmp21 = getelementptr float* %peakWeight, i64 %tmp20 ; <float*> [#uses=1] - %tmp22 = load float* %tmp21, align 4 ; <float> [#uses=1] + %tmp21 = getelementptr float, float* %peakWeight, i64 %tmp20 ; <float*> [#uses=1] + %tmp22 = load float, float* %tmp21, align 4 ; <float> [#uses=1] %tmp23 = fsub float %peakCount.01, %tmp22 ; <float> [#uses=2] %tmp24 = add i32 %loPart.02, 1 ; <i32> [#uses=2] br label %bb3 @@ -97,13 +97,13 @@ bb4: ; preds = %bb5, %bb.nph12 %hiPart.08 = phi i32 [ %tmp31, %bb5 ], [ %hiPart.119, %bb.nph12 ] ; <i32> [#uses=2] %peakCount.27 = phi float [ %tmp35, %bb5 ], [ %peakCount.0.lcssa, %bb.nph12 ] ; <float> [#uses=1] %tmp27 = sext i32 %hiPart.08 to i64 ; <i64> [#uses=1] - %tmp28 = getelementptr float* %pTmp1, i64 %tmp27 ; <float*> [#uses=1] - %tmp29 = load float* %tmp28, align 4 ; <float> [#uses=1] + %tmp28 = getelementptr float, float* %pTmp1, i64 %tmp27 ; <float*> [#uses=1] + %tmp29 = load float, float* %tmp28, align 4 ; <float> [#uses=1] %tmp30 = fadd float %tmp29, %distERBhi.29 ; <float> [#uses=3] %tmp31 = add i32 %hiPart.08, 1 ; <i32> [#uses=4] %tmp32 = sext i32 %tmp31 to i64 ; <i64> [#uses=1] - %tmp33 = getelementptr float* %peakWeight, i64 %tmp32 ; <float*> [#uses=1] - %tmp34 = load float* %tmp33, align 4 ; <float> [#uses=1] + %tmp33 = getelementptr float, float* %peakWeight, i64 %tmp32 ; <float*> [#uses=1] + %tmp34 = load float, float* %tmp33, align 4 ; <float> [#uses=1] %tmp35 = fadd float %tmp34, %peakCount.27 ; <float> [#uses=2] br label %bb5 @@ -132,7 +132,7 @@ bb7: ; preds = %bb5.bb7_crit_edge, %bb5.preheader %tmp42 = fadd float %tmp41, 1.000000e+00 ; <float> [#uses=1] %tmp43 = fdiv float 1.000000e+00, %tmp42 ; <float> [#uses=1] %tmp44 = sext i32 %part.016 to i64 ; <i64> [#uses=1] - %tmp45 = getelementptr float* %nrgReducePeakrate, i64 %tmp44 ; <float*> [#uses=1] + %tmp45 = getelementptr float, float* %nrgReducePeakrate, i64 %tmp44 ; <float*> [#uses=1] store float %tmp43, float* %tmp45, align 4 %tmp46 = add i32 %part.016, 1 ; <i32> [#uses=2] br label %bb8 diff --git a/test/Transforms/IndVarSimplify/iv-widen.ll b/test/Transforms/IndVarSimplify/iv-widen.ll index c899e2f..464b03c 100644 --- a/test/Transforms/IndVarSimplify/iv-widen.ll +++ b/test/Transforms/IndVarSimplify/iv-widen.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -indvars -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + target triple = "x86_64-apple-darwin" ; CHECK-LABEL: @sloop @@ -20,8 +24,8 @@ B18: ; preds = %B24, %Prologue %.02 = phi i32 [ 0, %Prologue ], [ %tmp33, %B24 ] %tmp23 = zext i32 %.02 to i64 %tmp33 = add i32 %.02, 1 - %o = getelementptr i32* %a, i32 %.02 - %v = load i32* %o + %o = getelementptr i32, i32* %a, i32 %.02 + %v = load i32, i32* %o %t = icmp eq i32 %v, 0 br i1 %t, label %exit24, label %B24 diff --git a/test/Transforms/IndVarSimplify/iv-zext.ll b/test/Transforms/IndVarSimplify/iv-zext.ll index ed0514b..629a85e 100644 --- a/test/Transforms/IndVarSimplify/iv-zext.ll +++ b/test/Transforms/IndVarSimplify/iv-zext.ll @@ -11,17 +11,17 @@ entry: loop: %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ] %indvar.i8 = and i64 %indvar, 255 - %t0 = getelementptr double* %d, i64 %indvar.i8 - %t1 = load double* %t0 + %t0 = getelementptr double, double* %d, i64 %indvar.i8 + %t1 = load double, double* %t0 %t2 = fmul double %t1, 0.1 store double %t2, double* %t0 %indvar.i24 = and i64 %indvar, 16777215 - %t3 = getelementptr double* %d, i64 %indvar.i24 - %t4 = load double* %t3 + %t3 = getelementptr double, double* %d, i64 %indvar.i24 + %t4 = load double, double* %t3 %t5 = fmul double %t4, 2.3 store double %t5, double* %t3 - %t6 = getelementptr double* %d, i64 %indvar - %t7 = load double* %t6 + %t6 = getelementptr double, double* %d, i64 %indvar + %t7 = load double, double* %t6 %t8 = fmul double %t7, 4.5 store double %t8, double* %t6 %indvar.next = add i64 %indvar, 1 diff --git a/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll b/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll index 9e55a17..feb4b35 100644 --- a/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll +++ b/test/Transforms/IndVarSimplify/lftr-address-space-pointers.ll @@ -6,12 +6,12 @@ define void @ptriv_as2(i8 addrspace(2)* %base, i32 %n) nounwind { ; CHECK-LABEL: @ptriv_as2( entry: %idx.trunc = trunc i32 %n to i8 - %add.ptr = getelementptr inbounds i8 addrspace(2)* %base, i8 %idx.trunc + %add.ptr = getelementptr inbounds i8, i8 addrspace(2)* %base, i8 %idx.trunc %cmp1 = icmp ult i8 addrspace(2)* %base, %add.ptr br i1 %cmp1, label %for.body, label %for.end ; Make sure the added GEP has the right index type -; CHECK: %lftr.limit = getelementptr i8 addrspace(2)* %base, i8 +; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(2)* %base, i8 %0 ; CHECK: for.body: ; CHECK: phi i8 addrspace(2)* @@ -26,7 +26,7 @@ for.body: %sub.ptr.rhs.cast = ptrtoint i8 addrspace(2)* %base to i8 %sub.ptr.sub = sub i8 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast store i8 %sub.ptr.sub, i8 addrspace(2)* %p.02 - %incdec.ptr = getelementptr inbounds i8 addrspace(2)* %p.02, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8 addrspace(2)* %p.02, i32 1 %cmp = icmp ult i8 addrspace(2)* %incdec.ptr, %add.ptr br i1 %cmp, label %for.body, label %for.end @@ -38,12 +38,12 @@ define void @ptriv_as3(i8 addrspace(3)* %base, i32 %n) nounwind { ; CHECK-LABEL: @ptriv_as3( entry: %idx.trunc = trunc i32 %n to i16 - %add.ptr = getelementptr inbounds i8 addrspace(3)* %base, i16 %idx.trunc + %add.ptr = getelementptr inbounds i8, i8 addrspace(3)* %base, i16 %idx.trunc %cmp1 = icmp ult i8 addrspace(3)* %base, %add.ptr br i1 %cmp1, label %for.body, label %for.end ; Make sure the added GEP has the right index type -; CHECK: %lftr.limit = getelementptr i8 addrspace(3)* %base, i16 +; CHECK: %lftr.limit = getelementptr i8, i8 addrspace(3)* %base, i16 %0 ; CHECK: for.body: ; CHECK: phi i8 addrspace(3)* @@ -59,7 +59,7 @@ for.body: %sub.ptr.sub = sub i16 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %conv = trunc i16 %sub.ptr.sub to i8 store i8 %conv, i8 addrspace(3)* %p.02 - %incdec.ptr = getelementptr inbounds i8 addrspace(3)* %p.02, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8 addrspace(3)* %p.02, i32 1 %cmp = icmp ult i8 addrspace(3)* %incdec.ptr, %add.ptr br i1 %cmp, label %for.body, label %for.end diff --git a/test/Transforms/IndVarSimplify/lftr-extend-const.ll b/test/Transforms/IndVarSimplify/lftr-extend-const.ll index f12c68c..fa3166d 100644 --- a/test/Transforms/IndVarSimplify/lftr-extend-const.ll +++ b/test/Transforms/IndVarSimplify/lftr-extend-const.ll @@ -1,5 +1,9 @@ ;RUN: opt -S %s -indvars | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; CHECK-LABEL: @foo( ; CHECK-NOT: %lftr.wideiv = trunc i32 %indvars.iv.next to i16 ; CHECK: %exitcond = icmp ne i32 %indvars.iv.next, 512 diff --git a/test/Transforms/IndVarSimplify/lftr-promote.ll b/test/Transforms/IndVarSimplify/lftr-promote.ll index c4ecc84..4fe3191 100644 --- a/test/Transforms/IndVarSimplify/lftr-promote.ll +++ b/test/Transforms/IndVarSimplify/lftr-promote.ll @@ -17,11 +17,11 @@ bb.nph: ; preds = %entry bb2: ; preds = %bb3, %bb.nph %i.01 = phi i32 [ %7, %bb3 ], [ 0, %bb.nph ] ; <i32> [#uses=3] %1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] - %2 = getelementptr double* %p, i64 %1 ; <double*> [#uses=1] - %3 = load double* %2, align 8 ; <double> [#uses=1] + %2 = getelementptr double, double* %p, i64 %1 ; <double*> [#uses=1] + %3 = load double, double* %2, align 8 ; <double> [#uses=1] %4 = fmul double %3, 1.100000e+00 ; <double> [#uses=1] %5 = sext i32 %i.01 to i64 ; <i64> [#uses=1] - %6 = getelementptr double* %p, i64 %5 ; <double*> [#uses=1] + %6 = getelementptr double, double* %p, i64 %5 ; <double*> [#uses=1] store double %4, double* %6, align 8 %7 = add i32 %i.01, 1 ; <i32> [#uses=2] br label %bb3 diff --git a/test/Transforms/IndVarSimplify/lftr-reuse.ll b/test/Transforms/IndVarSimplify/lftr-reuse.ll index efb96bd..b4e1fde 100644 --- a/test/Transforms/IndVarSimplify/lftr-reuse.ll +++ b/test/Transforms/IndVarSimplify/lftr-reuse.ll @@ -12,7 +12,7 @@ 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 @ptriv(i8* %base, i32 %n) nounwind { entry: %idx.ext = sext i32 %n to i64 - %add.ptr = getelementptr inbounds i8* %base, i64 %idx.ext + %add.ptr = getelementptr inbounds i8, i8* %base, i64 %idx.ext %cmp1 = icmp ult i8* %base, %add.ptr br i1 %cmp1, label %for.body, label %for.end @@ -30,7 +30,7 @@ for.body: %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %conv = trunc i64 %sub.ptr.sub to i8 store i8 %conv, i8* %p.02 - %incdec.ptr = getelementptr inbounds i8* %p.02, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %p.02, i32 1 %cmp = icmp ult i8* %incdec.ptr, %add.ptr br i1 %cmp, label %for.body, label %for.end @@ -82,23 +82,15 @@ exit: ; Perform LFTR without generating extra preheader code. define void @guardedloop([0 x double]* %matrix, [0 x double]* %vector, i32 %irow, i32 %ilead) nounwind { -; CHECK-LABEL: @guardedloop( -; CHECK-LABEL: entry: -; CHECK-NEXT: %[[cmp:.*]] = icmp slt i32 1, %irow -; CHECK-NEXT: br i1 %[[cmp]], label %[[loop_preheader:.*]], label %[[return:.*]] - -; CHECK: [[loop_preheader]]: -; CHECK-NEXT: %[[sext:.*]] = sext i32 %ilead to i64 -; CHECK-NEXT: %[[add:.*]] = add i32 %irow, -1 -; CHECK-NEXT: br label %[[loop:.*]] - -; CHECK: [[loop]]: -; CHECK-NEXT: %[[indvars_iv2:.*]] = phi i64 -; CHECK-NEXT: phi i64 +; CHECK: entry: +; CHECK-NOT: zext +; CHECK-NOT: add +; CHECK: loop: +; CHECK: phi i64 +; CHECK: phi i64 ; CHECK-NOT: phi -; CHECK: %[[lftr_wideiv:.*]] = trunc i64 %[[indvars_iv2]] to i32 -; CHECK-NEXT: %[[exitcond:.*]] = icmp ne i32 %[[lftr_wideiv]], %[[add]] -; CHECK-NEXT: br i1 %[[exitcond]], label %[[loop]], label +; CHECK: icmp ne +; CHECK: br i1 entry: %cmp = icmp slt i32 1, %irow br i1 %cmp, label %loop, label %return @@ -108,11 +100,11 @@ loop: %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ] %diagidx = add nsw i32 %rowidx, %i %diagidxw = sext i32 %diagidx to i64 - %matrixp = getelementptr inbounds [0 x double]* %matrix, i32 0, i64 %diagidxw - %v1 = load double* %matrixp + %matrixp = getelementptr inbounds [0 x double], [0 x double]* %matrix, i32 0, i64 %diagidxw + %v1 = load double, double* %matrixp %iw = sext i32 %i to i64 - %vectorp = getelementptr inbounds [0 x double]* %vector, i32 0, i64 %iw - %v2 = load double* %vectorp + %vectorp = getelementptr inbounds [0 x double], [0 x double]* %vector, i32 0, i64 %iw + %v2 = load double, double* %vectorp %row.inc = add nsw i32 %rowidx, %ilead %i.inc = add nsw i32 %i, 1 %cmp196 = icmp slt i32 %i.inc, %irow @@ -142,11 +134,11 @@ loop: %i = phi i32 [ 0, %entry ], [ %i.inc, %loop ] %diagidx = add nsw i32 %rowidx, %i %diagidxw = sext i32 %diagidx to i64 - %matrixp = getelementptr inbounds [0 x double]* %matrix, i32 0, i64 %diagidxw - %v1 = load double* %matrixp + %matrixp = getelementptr inbounds [0 x double], [0 x double]* %matrix, i32 0, i64 %diagidxw + %v1 = load double, double* %matrixp %iw = sext i32 %i to i64 - %vectorp = getelementptr inbounds [0 x double]* %vector, i32 0, i64 %iw - %v2 = load double* %vectorp + %vectorp = getelementptr inbounds [0 x double], [0 x double]* %vector, i32 0, i64 %iw + %v2 = load double, double* %vectorp %row.inc = add nsw i32 %rowidx, %ilead %i.inc = add nsw i32 %i, 1 %cmp196 = icmp slt i32 %i.inc, %irow @@ -165,9 +157,9 @@ return: define void @geplftr(i8* %base, i32 %x, i32 %y, i32 %n) nounwind { entry: %x.ext = sext i32 %x to i64 - %add.ptr = getelementptr inbounds i8* %base, i64 %x.ext + %add.ptr = getelementptr inbounds i8, i8* %base, i64 %x.ext %y.ext = sext i32 %y to i64 - %add.ptr10 = getelementptr inbounds i8* %add.ptr, i64 %y.ext + %add.ptr10 = getelementptr inbounds i8, i8* %add.ptr, i64 %y.ext %lim = add i32 %x, %n %cmp.ph = icmp ult i32 %x, %lim br i1 %cmp.ph, label %loop, label %exit @@ -182,7 +174,7 @@ entry: loop: %i = phi i32 [ %x, %entry ], [ %inc, %loop ] %aptr = phi i8* [ %add.ptr10, %entry ], [ %incdec.ptr, %loop ] - %incdec.ptr = getelementptr inbounds i8* %aptr, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %aptr, i32 1 store i8 3, i8* %aptr %inc = add i32 %i, 1 %cmp = icmp ult i32 %inc, %lim @@ -215,8 +207,8 @@ exit: ; Test LFTR on an IV whose recurrence start is a non-unit pointer type. define void @aryptriv([256 x i8]* %base, i32 %n) nounwind { entry: - %ivstart = getelementptr inbounds [256 x i8]* %base, i32 0, i32 0 - %ivend = getelementptr inbounds [256 x i8]* %base, i32 0, i32 %n + %ivstart = getelementptr inbounds [256 x i8], [256 x i8]* %base, i32 0, i32 0 + %ivend = getelementptr inbounds [256 x i8], [256 x i8]* %base, i32 0, i32 %n %cmp.ph = icmp ult i8* %ivstart, %ivend br i1 %cmp.ph, label %loop, label %exit @@ -229,7 +221,7 @@ entry: ; CHECK: br i1 loop: %aptr = phi i8* [ %ivstart, %entry ], [ %incdec.ptr, %loop ] - %incdec.ptr = getelementptr inbounds i8* %aptr, i32 1 + %incdec.ptr = getelementptr inbounds i8, i8* %aptr, i32 1 store i8 3, i8* %aptr %cmp = icmp ult i8* %incdec.ptr, %ivend br i1 %cmp, label %loop, label %exit diff --git a/test/Transforms/IndVarSimplify/lftr-zext.ll b/test/Transforms/IndVarSimplify/lftr-zext.ll index 32fa61a..e654e14 100644 --- a/test/Transforms/IndVarSimplify/lftr-zext.ll +++ b/test/Transforms/IndVarSimplify/lftr-zext.ll @@ -11,11 +11,11 @@ define void @foo(i8* %a) nounwind uwtable ssp { ; <label>:1 ; preds = %0, %1 %i.0 = phi i8 [ 0, %0 ], [ %5, %1 ] - %p.0 = phi i8* [ getelementptr inbounds ([240 x i8]* @data, i64 0, i64 0), %0 ], [ %4, %1 ] + %p.0 = phi i8* [ getelementptr inbounds ([240 x i8], [240 x i8]* @data, i64 0, i64 0), %0 ], [ %4, %1 ] %.0 = phi i8* [ %a, %0 ], [ %2, %1 ] - %2 = getelementptr inbounds i8* %.0, i64 1 - %3 = load i8* %.0, align 1 - %4 = getelementptr inbounds i8* %p.0, i64 1 + %2 = getelementptr inbounds i8, i8* %.0, i64 1 + %3 = load i8, i8* %.0, align 1 + %4 = getelementptr inbounds i8, i8* %p.0, i64 1 store i8 %3, i8* %p.0, align 1 %5 = add i8 %i.0, 1 %6 = icmp ult i8 %5, -16 diff --git a/test/Transforms/IndVarSimplify/lftr_simple.ll b/test/Transforms/IndVarSimplify/lftr_simple.ll index e373013..6a8d937 100644 --- a/test/Transforms/IndVarSimplify/lftr_simple.ll +++ b/test/Transforms/IndVarSimplify/lftr_simple.ll @@ -1,7 +1,11 @@ -; LFTR should eliminate the need for the computation of i*i completely. It +; LFTR should eliminate the need for the computation of i*i completely. It ; is only used to compute the exit value. ; RUN: opt < %s -indvars -dce -S | not grep mul +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + @A = external global i32 ; <i32*> [#uses=1] define i32 @quadratic_setlt() { diff --git a/test/Transforms/IndVarSimplify/loop_evaluate7.ll b/test/Transforms/IndVarSimplify/loop_evaluate7.ll index b9c0b12..333ab7a 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate7.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate7.ll @@ -21,7 +21,7 @@ bb19: ; preds = %bb30 br i1 undef, label %bb20, label %bb29 bb20: ; preds = %bb19 - %0 = load i32* undef, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* undef, align 4 ; <i32> [#uses=1] %1 = sub i32 %0, %n ; <i32> [#uses=1] br label %bb23 @@ -30,7 +30,7 @@ bb21: ; preds = %bb23 br i1 %2, label %bb22, label %overflow2 bb22: ; preds = %bb21 - %3 = getelementptr i8* %q.0, i32 1 ; <i8*> [#uses=1] + %3 = getelementptr i8, i8* %q.0, i32 1 ; <i8*> [#uses=1] br label %bb23 bb23: ; preds = %bb22, %bb20 diff --git a/test/Transforms/IndVarSimplify/loop_evaluate8.ll b/test/Transforms/IndVarSimplify/loop_evaluate8.ll index 2a9d205..28d05df 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate8.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate8.ll @@ -23,7 +23,7 @@ bb19: ; preds = %bb30 br i1 undef, label %bb20, label %bb29 bb20: ; preds = %bb19 - %0 = load i32* undef, align 4 ; <i32> [#uses=1] + %0 = load i32, i32* undef, align 4 ; <i32> [#uses=1] %1 = sub i32 %0, undef ; <i32> [#uses=1] br label %bb23 @@ -32,7 +32,7 @@ bb21: ; preds = %bb23 br i1 %2, label %bb22, label %overflow2 bb22: ; preds = %bb21 - %3 = getelementptr i8* %q.0, i32 1 ; <i8*> [#uses=1] + %3 = getelementptr i8, i8* %q.0, i32 1 ; <i8*> [#uses=1] br label %bb23 bb23: ; preds = %bb22, %bb20 diff --git a/test/Transforms/IndVarSimplify/loop_evaluate9.ll b/test/Transforms/IndVarSimplify/loop_evaluate9.ll index 21fb7ef..7a69bd2 100644 --- a/test/Transforms/IndVarSimplify/loop_evaluate9.ll +++ b/test/Transforms/IndVarSimplify/loop_evaluate9.ll @@ -28,7 +28,7 @@ bb1.i: ; preds = %bb2.i, %entry br i1 %tmp1, label %bb.i.i, label %bb1.i.i bb.i.i: ; preds = %bb1.i - tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn + tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn unreachable bb1.i.i: ; preds = %bb1.i @@ -39,7 +39,7 @@ bb1.i.i: ; preds = %bb1.i br i1 %tmp3, label %bb2.i.i, label %cc70a02__complex_integers__Oadd.153.exit.i bb2.i.i: ; preds = %bb1.i.i - tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn + tail call void @__gnat_rcheck_12(i8* getelementptr ([13 x i8], [13 x i8]* @.str, i32 0, i32 0), i32 24) noreturn unreachable cc70a02__complex_integers__Oadd.153.exit.i: ; preds = %bb1.i.i diff --git a/test/Transforms/IndVarSimplify/masked-iv.ll b/test/Transforms/IndVarSimplify/masked-iv.ll index f1f5af9..24fe33d 100644 --- a/test/Transforms/IndVarSimplify/masked-iv.ll +++ b/test/Transforms/IndVarSimplify/masked-iv.ll @@ -16,7 +16,7 @@ bb.preheader: ; preds = %entry bb: ; preds = %bb, %bb.preheader %i.01 = phi i64 [ %t6, %bb ], [ %a, %bb.preheader ] ; <i64> [#uses=3] %t1 = and i64 %i.01, 255 ; <i64> [#uses=1] - %t2 = getelementptr i64* %A, i64 %t1 ; <i64*> [#uses=1] + %t2 = getelementptr i64, i64* %A, i64 %t1 ; <i64*> [#uses=1] store i64 %i.01, i64* %t2, align 8 %t6 = add i64 %i.01, %s ; <i64> [#uses=1] br label %bb diff --git a/test/Transforms/IndVarSimplify/no-iv-rewrite.ll b/test/Transforms/IndVarSimplify/no-iv-rewrite.ll index a7023f2..ca7b899 100644 --- a/test/Transforms/IndVarSimplify/no-iv-rewrite.ll +++ b/test/Transforms/IndVarSimplify/no-iv-rewrite.ll @@ -28,8 +28,8 @@ loop: %i.02 = phi i32 [ 0, %ph ], [ %iinc, %loop ] %s.01 = phi i32 [ 0, %ph ], [ %sinc, %loop ] %ofs = sext i32 %i.02 to i64 - %adr = getelementptr inbounds i32* %arr, i64 %ofs - %val = load i32* %adr + %adr = getelementptr inbounds i32, i32* %arr, i64 %ofs + %val = load i32, i32* %adr %sinc = add nsw i32 %s.01, %val %iinc = add nsw i32 %i.02, 1 %cond = icmp slt i32 %iinc, %n @@ -69,8 +69,8 @@ loop: %i.02 = phi i32 [ 0, %ph ], [ %iinc, %loop ] %s.01 = phi i64 [ 0, %ph ], [ %sinc, %loop ] %ofs = sext i32 %i.02 to i64 - %adr = getelementptr inbounds i32* %arr, i64 %ofs - %val = load i32* %adr + %adr = getelementptr inbounds i32, i32* %arr, i64 %ofs + %val = load i32, i32* %adr %vall = sext i32 %val to i64 %sinc = add nsw i64 %s.01, %vall %iinc = add nsw i32 %i.02, 1 @@ -106,15 +106,15 @@ ph: ; CHECK-NOT: add ; ; Preserve gep inboundsness, and don't factor it. -; CHECK: getelementptr inbounds i32* %ptriv, i32 1 +; CHECK: getelementptr inbounds i32, i32* %ptriv, i32 1 ; CHECK-NOT: add ; CHECK: exit: loop: %ptriv = phi i32* [ %first, %ph ], [ %ptrpost, %loop ] %ofs = sext i32 %idx to i64 - %adr = getelementptr inbounds i32* %ptriv, i64 %ofs + %adr = getelementptr inbounds i32, i32* %ptriv, i64 %ofs store i32 3, i32* %adr - %ptrpost = getelementptr inbounds i32* %ptriv, i32 1 + %ptrpost = getelementptr inbounds i32, i32* %ptriv, i32 1 %cond = icmp ne i32* %ptrpost, %last br i1 %cond, label %loop, label %exit @@ -143,11 +143,11 @@ entry: loop: %iv = phi i32 [%start, %entry], [%next, %loop] %p = phi %structI* [%base, %entry], [%pinc, %loop] - %adr = getelementptr %structI* %p, i32 0, i32 0 + %adr = getelementptr %structI, %structI* %p, i32 0, i32 0 store i32 3, i32* %adr %pp = bitcast %structI* %p to i32* store i32 4, i32* %pp - %pinc = getelementptr %structI* %p, i32 1 + %pinc = getelementptr %structI, %structI* %p, i32 1 %next = add i32 %iv, 1 %cond = icmp ne i32 %next, %limit br i1 %cond, label %loop, label %exit @@ -170,8 +170,8 @@ loop: %idx = phi i32 [ 0, %entry ], [ %idx.next, %loop.inc ] %max = phi i32 [ 0, %entry ], [ %max.next, %loop.inc ] %idxprom = sext i32 %idx to i64 - %adr = getelementptr inbounds i32* %base, i64 %idxprom - %val = load i32* %adr + %adr = getelementptr inbounds i32, i32* %base, i64 %idxprom + %val = load i32, i32* %adr %cmp19 = icmp sgt i32 %val, %max br i1 %cmp19, label %if.then, label %if.else @@ -239,8 +239,8 @@ entry: loop: %iv = phi i32 [ 0, %entry], [ %iv.next, %loop ] %t1 = sext i32 %iv to i64 - %adr = getelementptr i64* %base, i64 %t1 - %val = load i64* %adr + %adr = getelementptr i64, i64* %base, i64 %t1 + %val = load i64, i64* %adr %t2 = or i32 %iv, 1 %t3 = sext i32 %t2 to i64 %iv.next = add i32 %iv, 2 @@ -333,7 +333,7 @@ return: define void @congruentgepiv(%structIF* %base) nounwind uwtable ssp { entry: - %first = getelementptr inbounds %structIF* %base, i64 0, i32 0 + %first = getelementptr inbounds %structIF, %structIF* %base, i64 0, i32 0 br label %loop ; CHECK: loop: @@ -349,8 +349,8 @@ loop: br i1 undef, label %latch, label %exit latch: ; preds = %for.inc50.i - %ptr.inc = getelementptr inbounds %structIF* %ptr.iv, i64 1 - %next.inc = getelementptr inbounds %structIF* %ptr.inc, i64 0, i32 0 + %ptr.inc = getelementptr inbounds %structIF, %structIF* %ptr.iv, i64 1 + %next.inc = getelementptr inbounds %structIF, %structIF* %ptr.inc, i64 0, i32 0 br label %loop exit: diff --git a/test/Transforms/IndVarSimplify/overflowcheck.ll b/test/Transforms/IndVarSimplify/overflowcheck.ll index 3864c6c..c3c033d 100644 --- a/test/Transforms/IndVarSimplify/overflowcheck.ll +++ b/test/Transforms/IndVarSimplify/overflowcheck.ll @@ -27,8 +27,8 @@ loop0: loop1: %zxt = zext i32 %i to i64 %ofs = shl nuw nsw i64 %zxt, 3 - %gep = getelementptr i64* %a, i64 %zxt - %v = load i64* %gep, align 8 + %gep = getelementptr i64, i64* %a, i64 %zxt + %v = load i64, i64* %gep, align 8 %truncv = trunc i64 %v to i32 %adds = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %s, i32 %truncv) %ovflows = extractvalue { i32, i1 } %adds, 1 diff --git a/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll b/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll index dc36b99..519d34d 100644 --- a/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll +++ b/test/Transforms/IndVarSimplify/phi-uses-value-multiple-times.ll @@ -13,7 +13,7 @@ entry: br label %bb38.i bb14.i27: - %t0 = load i64* @ue, align 8 + %t0 = load i64, i64* @ue, align 8 %t1 = sub i64 %t0, %i.0.i35 %t2 = add i64 %t1, 1 br i1 undef, label %bb15.i28, label %bb19.i31 diff --git a/test/Transforms/IndVarSimplify/polynomial-expand.ll b/test/Transforms/IndVarSimplify/polynomial-expand.ll index 2087f6a..5708c64 100644 --- a/test/Transforms/IndVarSimplify/polynomial-expand.ll +++ b/test/Transforms/IndVarSimplify/polynomial-expand.ll @@ -20,8 +20,8 @@ bb30: ; preds = %bb30, %bb24 %tmp31 = phi i32 [ %tmp39, %bb30 ], [ %tmp28, %bb24 ] ; <i32> [#uses=2] %tmp32 = phi i32 [ %tmp37, %bb30 ], [ %tmp27, %bb24 ] ; <i32> [#uses=2] %tmp33 = sext i32 %tmp32 to i64 ; <i64> [#uses=1] - %tmp35 = getelementptr float* %tmp4, i64 %tmp33 ; <%0*> [#uses=1] - %tmp36 = load float* %tmp35, align 4 ; <%0> [#uses=0] + %tmp35 = getelementptr float, float* %tmp4, i64 %tmp33 ; <%0*> [#uses=1] + %tmp36 = load float, float* %tmp35, align 4 ; <%0> [#uses=0] %tmp37 = add nsw i32 %tmp32, -1 ; <i32> [#uses=1] %tmp39 = add nsw i32 %tmp31, -1 ; <i32> [#uses=1] %tmp38 = icmp eq i32 %tmp31, 1 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/pr18223.ll b/test/Transforms/IndVarSimplify/pr18223.ll index 738f75c..f922aa4 100644 --- a/test/Transforms/IndVarSimplify/pr18223.ll +++ b/test/Transforms/IndVarSimplify/pr18223.ll @@ -8,7 +8,7 @@ define i32 @main() #0 { entry: - %0 = load i32* @c, align 4 + %0 = load i32, i32* @c, align 4 %tobool = icmp eq i32 %0, 0 br i1 %tobool, label %for.body, label %exit diff --git a/test/Transforms/IndVarSimplify/pr20680.ll b/test/Transforms/IndVarSimplify/pr20680.ll index 716e013..2c9eb54 100644 --- a/test/Transforms/IndVarSimplify/pr20680.ll +++ b/test/Transforms/IndVarSimplify/pr20680.ll @@ -1,5 +1,9 @@ ; RUN: opt < %s -indvars -S | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + @a = common global i32 0, align 4 @c = common global i32 0, align 4 @b = common global i32 0, align 4 @@ -13,9 +17,9 @@ define void @f() { ; CHECK-NEXT: %[[indvars_iv:.*]] = phi i32 [ %[[indvars_iv_next:.*]], %[[for_inc13:.*]] ], [ -14, %entry ] ; br i1 {{.*}}, label %[[for_inc13]], label % entry: - %0 = load i32* @a, align 4 + %0 = load i32, i32* @a, align 4 %tobool2 = icmp eq i32 %0, 0 - %1 = load i32* @a, align 4 + %1 = load i32, i32* @a, align 4 %tobool = icmp eq i32 %1, 0 br label %for.cond2.preheader @@ -51,7 +55,7 @@ cond.false.us.us: ; preds = %for.body3.us.us cond.end.us.us: ; preds = %cond.false.us.us, %for.body3.us.us %cond.us.us = phi i32 [ %div, %cond.false.us.us ], [ %conv7, %for.body3.us.us ] - %4 = load i32* @b, align 4 + %4 = load i32, i32* @b, align 4 %cmp91.us.us = icmp slt i32 %4, 1 br i1 %cmp91.us.us, label %for.inc.lr.ph.us.us, label %for.cond2.loopexit.us.us @@ -87,7 +91,7 @@ cond.false.us: ; preds = %for.body3.us cond.end.us: ; preds = %cond.false.us, %for.body3.us %cond.us = phi i32 [ %div, %cond.false.us ], [ %conv7, %for.body3.us ] - %6 = load i32* @b, align 4 + %6 = load i32, i32* @b, align 4 %cmp91.us = icmp slt i32 %6, 1 br i1 %cmp91.us, label %for.inc.lr.ph.us, label %for.cond2.loopexit.us @@ -133,7 +137,7 @@ cond.false.us4: ; preds = %for.body3.us3 cond.end.us5: ; preds = %cond.false.us4, %for.body3.us3 %cond.us6 = phi i32 [ %div, %cond.false.us4 ], [ %conv7, %for.body3.us3 ] - %8 = load i32* @b, align 4 + %8 = load i32, i32* @b, align 4 %cmp91.us7 = icmp slt i32 %8, 1 br i1 %cmp91.us7, label %for.inc.lr.ph.us12, label %for.cond2.loopexit.us11 @@ -177,7 +181,7 @@ cond.false: ; preds = %for.body3 cond.end: ; preds = %cond.false, %for.body3 %cond = phi i32 [ %div, %cond.false ], [ %conv7, %for.body3 ] - %10 = load i32* @b, align 4 + %10 = load i32, i32* @b, align 4 %cmp91 = icmp slt i32 %10, 1 br i1 %cmp91, label %for.inc.lr.ph, label %for.cond2.loopexit diff --git a/test/Transforms/IndVarSimplify/pr22222.ll b/test/Transforms/IndVarSimplify/pr22222.ll index ccdfe53..d1f0490 100644 --- a/test/Transforms/IndVarSimplify/pr22222.ll +++ b/test/Transforms/IndVarSimplify/pr22222.ll @@ -9,7 +9,7 @@ declare void @abort() #1 ; Function Attrs: nounwind ssp uwtable define i32 @main() { entry: - %a.promoted13 = load i32* @a, align 4 + %a.promoted13 = load i32, i32* @a, align 4 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.end diff --git a/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll b/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll index f619e8d..c8d34ac 100644 --- a/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll +++ b/test/Transforms/IndVarSimplify/preserve-signed-wrap.ll @@ -4,6 +4,10 @@ ; sext for the addressing, however it shouldn't eliminate the sext ; on the other phi, since that value undergoes signed wrapping. +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @foo(i32* nocapture %d, i32 %n) nounwind { entry: %0 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] @@ -21,7 +25,7 @@ bb: ; preds = %bb1, %bb.nph %p.01 = phi i8 [ %4, %bb1 ], [ -1, %bb.nph ] ; <i8> [#uses=2] %1 = sext i8 %p.01 to i32 ; <i32> [#uses=1] %2 = sext i32 %i.02 to i64 ; <i64> [#uses=1] - %3 = getelementptr i32* %d, i64 %2 ; <i32*> [#uses=1] + %3 = getelementptr i32, i32* %d, i64 %2 ; <i32*> [#uses=1] store i32 %1, i32* %3, align 4 %4 = add i8 %p.01, 1 ; <i8> [#uses=1] %5 = add i32 %i.02, 1 ; <i32> [#uses=2] diff --git a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll index a007ca6..f2afaf4 100644 --- a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll +++ b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll @@ -1,5 +1,8 @@ -; RUN: opt < %s -indvars -S > %t -; RUN: not grep sext %t +; RUN: opt < %s -indvars -S | not grep sext + +; Provide legal integer types. +target datalayout = "n8:16:32:64" + define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly { entry: @@ -13,8 +16,8 @@ bb: ; preds = %bb1, %bb.nph %result.02 = phi i64 [ %t5, %bb1 ], [ 0, %bb.nph ] ; <i64> [#uses=1] %n.01 = phi i32 [ %t6, %bb1 ], [ 0, %bb.nph ] ; <i32> [#uses=2] %t1 = sext i32 %n.01 to i64 ; <i64> [#uses=1] - %t2 = getelementptr i64* %first, i64 %t1 ; <i64*> [#uses=1] - %t3 = load i64* %t2, align 8 ; <i64> [#uses=1] + %t2 = getelementptr i64, i64* %first, i64 %t1 ; <i64*> [#uses=1] + %t3 = load i64, i64* %t2, align 8 ; <i64> [#uses=1] %t4 = lshr i64 %t3, 4 ; <i64> [#uses=1] %t5 = add i64 %t4, %result.02 ; <i64> [#uses=2] %t6 = add i32 %n.01, 1 ; <i32> [#uses=2] @@ -44,7 +47,7 @@ bb.nph: ; preds = %entry bb: ; preds = %bb1, %bb.nph %i.01 = phi i16 [ %t3, %bb1 ], [ 0, %bb.nph ] ; <i16> [#uses=2] %t1 = sext i16 %i.01 to i64 ; <i64> [#uses=1] - %t2 = getelementptr i32* %P, i64 %t1 ; <i32*> [#uses=1] + %t2 = getelementptr i32, i32* %P, i64 %t1 ; <i32*> [#uses=1] store i32 123, i32* %t2, align 4 %t3 = add i16 %i.01, 1 ; <i16> [#uses=2] br label %bb1 @@ -70,7 +73,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ -10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, 10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 10 ; <i1> [#uses=1] @@ -88,7 +91,7 @@ bb: ; preds = %bb, %bb.thread %i.0.reg2mem.0 = phi i8 [ 10, %bb.thread ], [ %tmp7, %bb ] ; <i8> [#uses=2] %tmp12 = sext i8 %i.0.reg2mem.0 to i32 ; <i32> [#uses=1] %tmp4 = add i32 %tmp12, -10 ; <i32> [#uses=1] - %tmp5 = getelementptr [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] + %tmp5 = getelementptr [21 x i32], [21 x i32]* %a, i32 0, i32 %tmp4 ; <i32*> [#uses=1] store i32 0, i32* %tmp5 %tmp7 = add i8 %i.0.reg2mem.0, 1 ; <i8> [#uses=2] %0 = icmp sgt i8 %tmp7, 30 ; <i1> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/sharpen-range.ll b/test/Transforms/IndVarSimplify/sharpen-range.ll index 5392dbc..c103da9 100644 --- a/test/Transforms/IndVarSimplify/sharpen-range.ll +++ b/test/Transforms/IndVarSimplify/sharpen-range.ll @@ -8,7 +8,7 @@ declare void @abort() define i1 @bounded_below_slt(i32* nocapture readonly %buffer) { ; CHECK-LABEL: bounded_below_slt entry: - %length = load i32* %buffer, !range !0 + %length = load i32, i32* %buffer, !range !0 %entry.pred = icmp eq i32 %length, 0 br i1 %entry.pred, label %abort, label %loop.preheader @@ -42,7 +42,7 @@ oob: define i1 @bounded_below_sle(i32* nocapture readonly %buffer) { ; CHECK-LABEL: bounded_below_sle entry: - %length = load i32* %buffer, !range !0 + %length = load i32, i32* %buffer, !range !0 %entry.pred = icmp eq i32 %length, 0 br i1 %entry.pred, label %abort, label %loop.preheader @@ -92,7 +92,7 @@ loop.begin: loop: ; CHECK: loop %.sum = add i64 %i.01, -2 - %v = getelementptr inbounds i8* null, i64 %.sum + %v = getelementptr inbounds i8, i8* null, i64 %.sum %r = tail call i32 @check(i8* %v) %c = icmp eq i32 %r, 0 br i1 %c, label %loop.end, label %abort.now diff --git a/test/Transforms/IndVarSimplify/signed-trip-count.ll b/test/Transforms/IndVarSimplify/signed-trip-count.ll index 1a5e64d..992e22e 100644 --- a/test/Transforms/IndVarSimplify/signed-trip-count.ll +++ b/test/Transforms/IndVarSimplify/signed-trip-count.ll @@ -2,6 +2,10 @@ ; RUN: not grep sext %t ; RUN: grep phi %t | count 1 +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @foo(i64* nocapture %x, i32 %n) nounwind { entry: %tmp102 = icmp sgt i32 %n, 0 ; <i1> [#uses=1] @@ -13,7 +17,7 @@ bb.nph: ; preds = %entry bb: ; preds = %bb7, %bb.nph %i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ] ; <i32> [#uses=3] %tmp1 = sext i32 %i.01 to i64 ; <i64> [#uses=1] - %tmp4 = getelementptr i64* %x, i32 %i.01 ; <i64*> [#uses=1] + %tmp4 = getelementptr i64, i64* %x, i32 %i.01 ; <i64*> [#uses=1] store i64 %tmp1, i64* %tmp4, align 8 %tmp6 = add i32 %i.01, 1 ; <i32> [#uses=2] br label %bb7 diff --git a/test/Transforms/IndVarSimplify/single-element-range.ll b/test/Transforms/IndVarSimplify/single-element-range.ll index 4b035ee..e047a0b 100644 --- a/test/Transforms/IndVarSimplify/single-element-range.ll +++ b/test/Transforms/IndVarSimplify/single-element-range.ll @@ -8,7 +8,7 @@ entry: br i1 undef, label %return, label %bb bb: ; preds = %entry - %0 = load i8** undef, align 4 ; <i8*> [#uses=2] + %0 = load i8*, i8** undef, align 4 ; <i8*> [#uses=2] %1 = ptrtoint i8* %0 to i32 ; <i32> [#uses=1] %2 = icmp sgt i8* %0, inttoptr (i32 1 to i8*) ; <i1> [#uses=1] br i1 %2, label %bb1, label %bb5 diff --git a/test/Transforms/IndVarSimplify/sink-alloca.ll b/test/Transforms/IndVarSimplify/sink-alloca.ll index 64207d8..8179470 100644 --- a/test/Transforms/IndVarSimplify/sink-alloca.ll +++ b/test/Transforms/IndVarSimplify/sink-alloca.ll @@ -19,7 +19,7 @@ while.cond: ; preds = %while.cond, %entry while.end: ; preds = %while.cond store volatile i32 0, i32* %result.i - %tmp.i = load volatile i32* %result.i ; <i32> [#uses=0] + %tmp.i = load volatile i32, i32* %result.i ; <i32> [#uses=0] ret i32 0 } declare i32 @bar() @@ -43,7 +43,7 @@ entry: for.body.i: %indvars.iv37.i = phi i64 [ %indvars.iv.next38.i, %for.body.i ], [ 0, %entry ] %call.i = call i8* (...)* @a() nounwind - %arrayidx.i = getelementptr inbounds i8** %vla.i, i64 %indvars.iv37.i + %arrayidx.i = getelementptr inbounds i8*, i8** %vla.i, i64 %indvars.iv37.i store i8* %call.i, i8** %arrayidx.i, align 8 %indvars.iv.next38.i = add i64 %indvars.iv37.i, 1 %exitcond5 = icmp eq i64 %indvars.iv.next38.i, %n diff --git a/test/Transforms/IndVarSimplify/udiv.ll b/test/Transforms/IndVarSimplify/udiv.ll index aee455d..11c5e16 100644 --- a/test/Transforms/IndVarSimplify/udiv.ll +++ b/test/Transforms/IndVarSimplify/udiv.ll @@ -17,8 +17,8 @@ entry: br i1 %cmp, label %cond.true, label %while.cond.preheader cond.true: ; preds = %entry - %arrayidx = getelementptr inbounds i8** %argv, i64 1 ; <i8**> [#uses=1] - %tmp2 = load i8** %arrayidx ; <i8*> [#uses=1] + %arrayidx = getelementptr inbounds i8*, i8** %argv, i64 1 ; <i8**> [#uses=1] + %tmp2 = load i8*, i8** %arrayidx ; <i8*> [#uses=1] %call = tail call i32 @atoi(i8* %tmp2) nounwind readonly ; <i32> [#uses=1] br label %while.cond.preheader @@ -59,7 +59,7 @@ bb.nph: ; preds = %for.cond.preheader for.body: ; preds = %bb.nph, %for.cond %i.02 = phi i64 [ 2, %bb.nph ], [ %inc, %for.cond ] ; <i64> [#uses=2] - %arrayidx10 = getelementptr inbounds [8193 x i8]* @main.flags, i64 0, i64 %i.02 ; <i8*> [#uses=1] + %arrayidx10 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %i.02 ; <i8*> [#uses=1] store i8 1, i8* %arrayidx10 %inc = add nsw i64 %i.02, 1 ; <i64> [#uses=2] br label %for.cond @@ -81,8 +81,8 @@ bb.nph16: ; preds = %for.cond12.loopexit for.body15: ; preds = %bb.nph16, %for.cond12 %count.212 = phi i32 [ 0, %bb.nph16 ], [ %count.1, %for.cond12 ] ; <i32> [#uses=2] %i.17 = phi i64 [ 2, %bb.nph16 ], [ %inc37, %for.cond12 ] ; <i64> [#uses=4] - %arrayidx17 = getelementptr inbounds [8193 x i8]* @main.flags, i64 0, i64 %i.17 ; <i8*> [#uses=1] - %tmp18 = load i8* %arrayidx17 ; <i8> [#uses=1] + %arrayidx17 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %i.17 ; <i8*> [#uses=1] + %tmp18 = load i8, i8* %arrayidx17 ; <i8> [#uses=1] %tobool19 = icmp eq i8 %tmp18, 0 ; <i1> [#uses=1] br i1 %tobool19, label %for.inc35, label %if.then @@ -103,7 +103,7 @@ bb.nph5: ; preds = %if.then for.body25: ; preds = %bb.nph5, %for.cond22 %k.04 = phi i64 [ %add, %bb.nph5 ], [ %add31, %for.cond22 ] ; <i64> [#uses=2] - %arrayidx27 = getelementptr inbounds [8193 x i8]* @main.flags, i64 0, i64 %k.04 ; <i8*> [#uses=1] + %arrayidx27 = getelementptr inbounds [8193 x i8], [8193 x i8]* @main.flags, i64 0, i64 %k.04 ; <i8*> [#uses=1] store i8 0, i8* %arrayidx27 %add31 = add nsw i64 %k.04, %i.17 ; <i64> [#uses=2] br label %for.cond22 @@ -119,7 +119,7 @@ for.inc35: ; preds = %for.body15, %for.en while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %count.0.lcssa = phi i32 [ %count.2.lcssa.lcssa, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] ; <i32> [#uses=1] - %call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0] + %call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0] ret i32 0 } @@ -146,7 +146,7 @@ for.body.preheader: ; preds = %entry for.body: ; preds = %for.body.preheader, %for.body %i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ] ; <i64> [#uses=2] - %arrayidx = getelementptr inbounds double* %p, i64 %i.03 ; <double*> [#uses=1] + %arrayidx = getelementptr inbounds double, double* %p, i64 %i.03 ; <double*> [#uses=1] store double 0.000000e+00, double* %arrayidx %inc = add i64 %i.03, 1 ; <i64> [#uses=2] %divx = udiv i64 %n, 7 ; <i64> [#uses=1] diff --git a/test/Transforms/IndVarSimplify/uglygep.ll b/test/Transforms/IndVarSimplify/uglygep.ll index 0014b68..e434389 100644 --- a/test/Transforms/IndVarSimplify/uglygep.ll +++ b/test/Transforms/IndVarSimplify/uglygep.ll @@ -27,10 +27,10 @@ bb2: ; preds = %bb1, %bb br i1 %tmp8, label %bb1, label %bb3 bb1: ; preds = %bb2 - %tmp = load double*** @tds, align 8 ; <double**> [#uses=1] + %tmp = load double**, double*** @tds, align 8 ; <double**> [#uses=1] %tmp1 = sext i32 %i.0 to i64 ; <i64> [#uses=1] - %tmp2 = getelementptr inbounds double** %tmp, i64 %tmp1 ; <double**> [#uses=1] - %tmp3 = load double** %tmp2, align 1 ; <double*> [#uses=1] + %tmp2 = getelementptr inbounds double*, double** %tmp, i64 %tmp1 ; <double**> [#uses=1] + %tmp3 = load double*, double** %tmp2, align 1 ; <double*> [#uses=1] %tmp6 = add nsw i32 %j.0, 1 ; <i32> [#uses=1] br label %bb2 diff --git a/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll b/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll index a421003..7272ef1 100644 --- a/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll +++ b/test/Transforms/IndVarSimplify/ult-sub-to-eq.ll @@ -1,5 +1,9 @@ ; RUN: opt -S -indvars < %s | FileCheck %s +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + define void @test1(float* nocapture %autoc, float* nocapture %data, float %d, i32 %data_len, i32 %sample) nounwind { entry: %sub = sub i32 %data_len, %sample @@ -11,11 +15,11 @@ for.body: ; preds = %entry, %for.body %0 = trunc i64 %indvars.iv to i32 %add = add i32 %0, %sample %idxprom = zext i32 %add to i64 - %arrayidx = getelementptr inbounds float* %data, i64 %idxprom - %1 = load float* %arrayidx, align 4 + %arrayidx = getelementptr inbounds float, float* %data, i64 %idxprom + %1 = load float, float* %arrayidx, align 4 %mul = fmul float %1, %d - %arrayidx2 = getelementptr inbounds float* %autoc, i64 %indvars.iv - %2 = load float* %arrayidx2, align 4 + %arrayidx2 = getelementptr inbounds float, float* %autoc, i64 %indvars.iv + %2 = load float, float* %arrayidx2, align 4 %add3 = fadd float %2, %mul store float %add3, float* %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 diff --git a/test/Transforms/IndVarSimplify/use-range-metadata.ll b/test/Transforms/IndVarSimplify/use-range-metadata.ll index ea3b12d..1f01426 100644 --- a/test/Transforms/IndVarSimplify/use-range-metadata.ll +++ b/test/Transforms/IndVarSimplify/use-range-metadata.ll @@ -6,7 +6,7 @@ declare void @abort() define i1 @iterate(i32* nocapture readonly %buffer) { entry: - %length = load i32* %buffer, !range !0 + %length = load i32, i32* %buffer, !range !0 br label %loop.preheader loop.preheader: diff --git a/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll b/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll index fb9ef22..5fa4a17 100644 --- a/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll +++ b/test/Transforms/IndVarSimplify/variable-stride-ivs-0.ll @@ -6,17 +6,17 @@ define void @vnum_test8(i32* %data) { entry: - %tmp.1 = getelementptr i32* %data, i32 3 ; <i32*> [#uses=1] - %tmp.2 = load i32* %tmp.1 ; <i32> [#uses=2] - %tmp.4 = getelementptr i32* %data, i32 4 ; <i32*> [#uses=1] - %tmp.5 = load i32* %tmp.4 ; <i32> [#uses=2] - %tmp.8 = getelementptr i32* %data, i32 2 ; <i32*> [#uses=1] - %tmp.9 = load i32* %tmp.8 ; <i32> [#uses=3] + %tmp.1 = getelementptr i32, i32* %data, i32 3 ; <i32*> [#uses=1] + %tmp.2 = load i32, i32* %tmp.1 ; <i32> [#uses=2] + %tmp.4 = getelementptr i32, i32* %data, i32 4 ; <i32*> [#uses=1] + %tmp.5 = load i32, i32* %tmp.4 ; <i32> [#uses=2] + %tmp.8 = getelementptr i32, i32* %data, i32 2 ; <i32*> [#uses=1] + %tmp.9 = load i32, i32* %tmp.8 ; <i32> [#uses=3] %tmp.125 = icmp sgt i32 %tmp.2, 0 ; <i1> [#uses=1] br i1 %tmp.125, label %no_exit.preheader, label %return no_exit.preheader: ; preds = %entry - %tmp.16 = getelementptr i32* %data, i32 %tmp.9 ; <i32*> [#uses=1] + %tmp.16 = getelementptr i32, i32* %data, i32 %tmp.9 ; <i32*> [#uses=1] br label %no_exit ; CHECK: store i32 0 diff --git a/test/Transforms/IndVarSimplify/verify-scev.ll b/test/Transforms/IndVarSimplify/verify-scev.ll index b9ce3d6..ddf2e7f 100644 --- a/test/Transforms/IndVarSimplify/verify-scev.ll +++ b/test/Transforms/IndVarSimplify/verify-scev.ll @@ -175,7 +175,7 @@ if.end250: ; preds = %for.cond246 br i1 undef, label %if.end256, label %for.end562 if.end256: ; preds = %if.end250 - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 br i1 undef, label %if.then274, label %for.cond404.preheader for.cond404.preheader: ; preds = %if.end256 @@ -379,7 +379,7 @@ for.body48: ; preds = %for.inc221, %for.bo br i1 undef, label %for.inc221, label %for.body65.lr.ph for.body65.lr.ph: ; preds = %for.body48 - %0 = load i32* undef, align 4 + %0 = load i32, i32* undef, align 4 %1 = sext i32 %0 to i64 br label %for.body65.us diff --git a/test/Transforms/IndVarSimplify/widen-loop-comp.ll b/test/Transforms/IndVarSimplify/widen-loop-comp.ll index 0930a0c..eb81ceb 100644 --- a/test/Transforms/IndVarSimplify/widen-loop-comp.ll +++ b/test/Transforms/IndVarSimplify/widen-loop-comp.ll @@ -1,6 +1,10 @@ ; RUN: opt < %s -indvars -S | FileCheck %s target triple = "aarch64--linux-gnu" +; Provide legal integer types. +target datalayout = "n8:16:32:64" + + ; Check the loop exit i32 compare instruction and operand are widened to i64 ; instead of truncating IV before its use in the i32 compare instruction. @@ -19,13 +23,13 @@ target triple = "aarch64--linux-gnu" define i32 @test1() { entry: store i32 -1, i32* @idx, align 4 - %0 = load i32* @e, align 4 + %0 = load i32, i32* @e, align 4 %cmp4 = icmp slt i32 %0, 0 br i1 %cmp4, label %for.end.loopexit, label %for.body.lr.ph for.body.lr.ph: - %1 = load i32** @ptr, align 8 - %2 = load i32* @e, align 4 + %1 = load i32*, i32** @ptr, align 8 + %2 = load i32, i32* @e, align 4 br label %for.body for.cond: @@ -36,8 +40,8 @@ for.cond: for.body: %i.05 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.cond ] %idxprom = sext i32 %i.05 to i64 - %arrayidx = getelementptr inbounds i32* %1, i64 %idxprom - %3 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %1, i64 %idxprom + %3 = load i32, i32* %arrayidx, align 4 %tobool = icmp eq i32 %3, 0 br i1 %tobool, label %if.then, label %for.cond @@ -53,7 +57,7 @@ for.end.loopexit: br label %for.end for.end: - %4 = load i32* @idx, align 4 + %4 = load i32, i32* @idx, align 4 ret i32 %4 } @@ -81,11 +85,11 @@ for.inc13.us: for.body4.us: %storemerge14.us = phi i32 [ 0, %for.body4.lr.ph.us ], [ %inc.us, %for.body4.us ] %idxprom.us = sext i32 %storemerge14.us to i64 - %arrayidx6.us = getelementptr inbounds [8 x i8]* %a, i64 %idxprom5.us, i64 %idxprom.us - %0 = load i8* %arrayidx6.us, align 1 + %arrayidx6.us = getelementptr inbounds [8 x i8], [8 x i8]* %a, i64 %idxprom5.us, i64 %idxprom.us + %0 = load i8, i8* %arrayidx6.us, align 1 %idxprom7.us = zext i8 %0 to i64 - %arrayidx8.us = getelementptr inbounds i8* %b, i64 %idxprom7.us - %1 = load i8* %arrayidx8.us, align 1 + %arrayidx8.us = getelementptr inbounds i8, i8* %b, i64 %idxprom7.us + %1 = load i8, i8* %arrayidx8.us, align 1 store i8 %1, i8* %arrayidx6.us, align 1 %inc.us = add nsw i32 %storemerge14.us, 1 %cmp2.us = icmp slt i32 %inc.us, %conv @@ -126,8 +130,8 @@ for.cond: for.body: %idxprom = sext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %sum.0, %0 %inc = add nsw i32 %i.0, 1 br label %for.cond @@ -180,8 +184,8 @@ for.cond: for.body: %idxprom = zext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %sum.0, %0 %inc = add nsw i32 %i.0, 1 br label %for.cond diff --git a/test/Transforms/IndVarSimplify/widen-nsw.ll b/test/Transforms/IndVarSimplify/widen-nsw.ll index 56c3c0d..8dbbb51 100644 --- a/test/Transforms/IndVarSimplify/widen-nsw.ll +++ b/test/Transforms/IndVarSimplify/widen-nsw.ll @@ -16,8 +16,8 @@ for.cond: ; preds = %for.body, %entry for.body: ; preds = %for.cond %idxprom = sext i32 %i.0 to i64 - %arrayidx = getelementptr inbounds i32* %a, i64 %idxprom - %0 = load i32* %arrayidx, align 4 + %arrayidx = getelementptr inbounds i32, i32* %a, i64 %idxprom + %0 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %sum.0, %0 %inc = add nsw i32 %i.0, 1 br label %for.cond |