1*cee313d2SEric Christopher; RUN: opt < %s -indvars 2*cee313d2SEric Christopher; PR4271 3*cee313d2SEric Christopher 4*cee313d2SEric Christophertarget datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" 5*cee313d2SEric Christophertarget triple = "i386-apple-darwin10.0" 6*cee313d2SEric Christopher %struct.xyz = type <{ i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, [8 x i8], i64, i64, i32, i32, [4 x i32], i32, i32, i32, i32, i32, i32, [76 x i32], i32, [2 x %struct.uvw] }> 7*cee313d2SEric Christopher %struct.uvw = type <{ i64, i64 }> 8*cee313d2SEric Christopher 9*cee313d2SEric Christopherdefine i32 @foo(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind { 10*cee313d2SEric Christopherentry: 11*cee313d2SEric Christopher br label %while.body.i 12*cee313d2SEric Christopher 13*cee313d2SEric Christopherwhile.body.i: ; preds = %while.body.i, %entry 14*cee313d2SEric Christopher br i1 undef, label %while.body.i, label %bcopy_internal.exit 15*cee313d2SEric Christopher 16*cee313d2SEric Christopherbcopy_internal.exit: ; preds = %while.body.i 17*cee313d2SEric Christopher %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1] 18*cee313d2SEric Christopher %shr136 = lshr i32 %conv135, 12 ; <i32> [#uses=1] 19*cee313d2SEric Christopher br label %for.body 20*cee313d2SEric Christopher 21*cee313d2SEric Christopherfor.body: ; preds = %for.body, %bcopy_internal.exit 22*cee313d2SEric Christopher %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1] 23*cee313d2SEric Christopher %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2] 24*cee313d2SEric Christopher %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1] 25*cee313d2SEric Christopher br i1 %cmp, label %if.then199, label %for.body 26*cee313d2SEric Christopher 27*cee313d2SEric Christopherif.then199: ; preds = %if.then199, %for.body 28*cee313d2SEric Christopher br label %if.then199 29*cee313d2SEric Christopher} 30*cee313d2SEric Christopher 31*cee313d2SEric Christopherdefine i32 @same_thing_but_signed(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind { 32*cee313d2SEric Christopherentry: 33*cee313d2SEric Christopher br label %while.body.i 34*cee313d2SEric Christopher 35*cee313d2SEric Christopherwhile.body.i: ; preds = %while.body.i, %entry 36*cee313d2SEric Christopher br i1 undef, label %while.body.i, label %bcopy_internal.exit 37*cee313d2SEric Christopher 38*cee313d2SEric Christopherbcopy_internal.exit: ; preds = %while.body.i 39*cee313d2SEric Christopher %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1] 40*cee313d2SEric Christopher %shr136 = ashr i32 %conv135, 12 ; <i32> [#uses=1] 41*cee313d2SEric Christopher br label %for.body 42*cee313d2SEric Christopher 43*cee313d2SEric Christopherfor.body: ; preds = %for.body, %bcopy_internal.exit 44*cee313d2SEric Christopher %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1] 45*cee313d2SEric Christopher %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2] 46*cee313d2SEric Christopher %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1] 47*cee313d2SEric Christopher br i1 %cmp, label %if.then199, label %for.body 48*cee313d2SEric Christopher 49*cee313d2SEric Christopherif.then199: ; preds = %if.then199, %for.body 50*cee313d2SEric Christopher br label %if.then199 51*cee313d2SEric Christopher} 52*cee313d2SEric Christopher 53*cee313d2SEric Christopherdefine i32 @same_thing_but_multiplied(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind { 54*cee313d2SEric Christopherentry: 55*cee313d2SEric Christopher br label %while.body.i 56*cee313d2SEric Christopher 57*cee313d2SEric Christopherwhile.body.i: ; preds = %while.body.i, %entry 58*cee313d2SEric Christopher br i1 undef, label %while.body.i, label %bcopy_internal.exit 59*cee313d2SEric Christopher 60*cee313d2SEric Christopherbcopy_internal.exit: ; preds = %while.body.i 61*cee313d2SEric Christopher %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1] 62*cee313d2SEric Christopher %shr136 = shl i32 %conv135, 12 ; <i32> [#uses=1] 63*cee313d2SEric Christopher br label %for.body 64*cee313d2SEric Christopher 65*cee313d2SEric Christopherfor.body: ; preds = %for.body, %bcopy_internal.exit 66*cee313d2SEric Christopher %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1] 67*cee313d2SEric Christopher %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2] 68*cee313d2SEric Christopher %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1] 69*cee313d2SEric Christopher br i1 %cmp, label %if.then199, label %for.body 70*cee313d2SEric Christopher 71*cee313d2SEric Christopherif.then199: ; preds = %if.then199, %for.body 72*cee313d2SEric Christopher br label %if.then199 73*cee313d2SEric Christopher} 74*cee313d2SEric Christopher 75*cee313d2SEric Christopherdefine i32 @same_thing_but_xored(%struct.xyz* %header, i8* %p2, i8* %p3, i8* nocapture %p4) nounwind { 76*cee313d2SEric Christopherentry: 77*cee313d2SEric Christopher br label %while.body.i 78*cee313d2SEric Christopher 79*cee313d2SEric Christopherwhile.body.i: ; preds = %while.body.i, %entry 80*cee313d2SEric Christopher br i1 undef, label %while.body.i, label %bcopy_internal.exit 81*cee313d2SEric Christopher 82*cee313d2SEric Christopherbcopy_internal.exit: ; preds = %while.body.i 83*cee313d2SEric Christopher %conv135 = ptrtoint %struct.xyz* %header to i32 ; <i32> [#uses=1] 84*cee313d2SEric Christopher %shr136 = xor i32 %conv135, 12 ; <i32> [#uses=1] 85*cee313d2SEric Christopher br label %for.body 86*cee313d2SEric Christopher 87*cee313d2SEric Christopherfor.body: ; preds = %for.body, %bcopy_internal.exit 88*cee313d2SEric Christopher %ppnum.052 = phi i32 [ %inc, %for.body ], [ %shr136, %bcopy_internal.exit ] ; <i32> [#uses=1] 89*cee313d2SEric Christopher %inc = add i32 %ppnum.052, 1 ; <i32> [#uses=2] 90*cee313d2SEric Christopher %cmp = icmp ugt i32 %inc, undef ; <i1> [#uses=1] 91*cee313d2SEric Christopher br i1 %cmp, label %if.then199, label %for.body 92*cee313d2SEric Christopher 93*cee313d2SEric Christopherif.then199: ; preds = %if.then199, %for.body 94*cee313d2SEric Christopher br label %if.then199 95*cee313d2SEric Christopher} 96