1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -loop-rotate -verify-dom-info -verify-loop-info -S | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: [ {{.}}tmp224 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Workertarget 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" 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } 7*9880d681SAndroid Build Coastguard Worker %struct.Index_Map = type { i32, %struct.item_set** } 8*9880d681SAndroid Build Coastguard Worker %struct.Item = type { [4 x i16], %struct.rule* } 9*9880d681SAndroid Build Coastguard Worker %struct.__sFILEX = type opaque 10*9880d681SAndroid Build Coastguard Worker %struct.__sbuf = type { i8*, i32 } 11*9880d681SAndroid Build Coastguard Worker %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* } 12*9880d681SAndroid Build Coastguard Worker %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* } 13*9880d681SAndroid Build Coastguard Worker %struct.list = type { i8*, %struct.list* } 14*9880d681SAndroid Build Coastguard Worker %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** } 15*9880d681SAndroid Build Coastguard Worker %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* } 16*9880d681SAndroid Build Coastguard Worker %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* } 17*9880d681SAndroid Build Coastguard Worker %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] } 18*9880d681SAndroid Build Coastguard Worker %struct.plank = type { i8*, %struct.list*, i32 } 19*9880d681SAndroid Build Coastguard Worker %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* } 20*9880d681SAndroid Build Coastguard Worker %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 } 21*9880d681SAndroid Build Coastguard Worker %struct.stateMap = type { i8*, %struct.plank*, i32, i16* } 22*9880d681SAndroid Build Coastguard Worker %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** } 23*9880d681SAndroid Build Coastguard Worker@outfile = external global %struct.FILE* ; <%struct.FILE**> [#uses=1] 24*9880d681SAndroid Build Coastguard Worker@str1 = external constant [11 x i8] ; <[11 x i8]*> [#uses=1] 25*9880d681SAndroid Build Coastguard Worker@operators = weak global %struct.list* null ; <%struct.list**> [#uses=1] 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Workerdefine i32 @opsOfArity(i32 %arity) { 30*9880d681SAndroid Build Coastguard Workerentry: 31*9880d681SAndroid Build Coastguard Worker %arity_addr = alloca i32 ; <i32*> [#uses=2] 32*9880d681SAndroid Build Coastguard Worker %retval = alloca i32, align 4 ; <i32*> [#uses=2] 33*9880d681SAndroid Build Coastguard Worker %tmp = alloca i32, align 4 ; <i32*> [#uses=2] 34*9880d681SAndroid Build Coastguard Worker %c = alloca i32, align 4 ; <i32*> [#uses=4] 35*9880d681SAndroid Build Coastguard Worker %l = alloca %struct.list*, align 4 ; <%struct.list**> [#uses=5] 36*9880d681SAndroid Build Coastguard Worker %op = alloca %struct.operator*, align 4 ; <%struct.operator**> [#uses=3] 37*9880d681SAndroid Build Coastguard Worker store i32 %arity, i32* %arity_addr 38*9880d681SAndroid Build Coastguard Worker store i32 0, i32* %c 39*9880d681SAndroid Build Coastguard Worker %tmp1 = load %struct.list*, %struct.list** @operators ; <%struct.list*> [#uses=1] 40*9880d681SAndroid Build Coastguard Worker store %struct.list* %tmp1, %struct.list** %l 41*9880d681SAndroid Build Coastguard Worker br label %bb21 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Workerbb: ; preds = %bb21 44*9880d681SAndroid Build Coastguard Worker %tmp3 = getelementptr %struct.list, %struct.list* %tmp22, i32 0, i32 0 ; <i8**> [#uses=1] 45*9880d681SAndroid Build Coastguard Worker %tmp4 = load i8*, i8** %tmp3 ; <i8*> [#uses=1] 46*9880d681SAndroid Build Coastguard Worker %tmp45 = bitcast i8* %tmp4 to %struct.operator* ; <%struct.operator*> [#uses=1] 47*9880d681SAndroid Build Coastguard Worker store %struct.operator* %tmp45, %struct.operator** %op 48*9880d681SAndroid Build Coastguard Worker %tmp6 = load %struct.operator*, %struct.operator** %op ; <%struct.operator*> [#uses=1] 49*9880d681SAndroid Build Coastguard Worker %tmp7 = getelementptr %struct.operator, %struct.operator* %tmp6, i32 0, i32 5 ; <i32*> [#uses=1] 50*9880d681SAndroid Build Coastguard Worker %tmp8 = load i32, i32* %tmp7 ; <i32> [#uses=1] 51*9880d681SAndroid Build Coastguard Worker %tmp9 = load i32, i32* %arity_addr ; <i32> [#uses=1] 52*9880d681SAndroid Build Coastguard Worker icmp eq i32 %tmp8, %tmp9 ; <i1>:0 [#uses=1] 53*9880d681SAndroid Build Coastguard Worker zext i1 %0 to i8 ; <i8>:1 [#uses=1] 54*9880d681SAndroid Build Coastguard Worker icmp ne i8 %1, 0 ; <i1>:2 [#uses=1] 55*9880d681SAndroid Build Coastguard Worker br i1 %2, label %cond_true, label %cond_next 56*9880d681SAndroid Build Coastguard Worker 57*9880d681SAndroid Build Coastguard Workercond_true: ; preds = %bb 58*9880d681SAndroid Build Coastguard Worker %tmp10 = load %struct.operator*, %struct.operator** %op ; <%struct.operator*> [#uses=1] 59*9880d681SAndroid Build Coastguard Worker %tmp11 = getelementptr %struct.operator, %struct.operator* %tmp10, i32 0, i32 2 ; <i32*> [#uses=1] 60*9880d681SAndroid Build Coastguard Worker %tmp12 = load i32, i32* %tmp11 ; <i32> [#uses=1] 61*9880d681SAndroid Build Coastguard Worker %tmp13 = load %struct.FILE*, %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1] 62*9880d681SAndroid Build Coastguard Worker %tmp14 = getelementptr [11 x i8], [11 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1] 63*9880d681SAndroid Build Coastguard Worker %tmp15 = call i32 (%struct.FILE*, i8*, ...) @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; <i32> [#uses=0] 64*9880d681SAndroid Build Coastguard Worker %tmp16 = load i32, i32* %c ; <i32> [#uses=1] 65*9880d681SAndroid Build Coastguard Worker %tmp17 = add i32 %tmp16, 1 ; <i32> [#uses=1] 66*9880d681SAndroid Build Coastguard Worker store i32 %tmp17, i32* %c 67*9880d681SAndroid Build Coastguard Worker br label %cond_next 68*9880d681SAndroid Build Coastguard Worker 69*9880d681SAndroid Build Coastguard Workercond_next: ; preds = %cond_true, %bb 70*9880d681SAndroid Build Coastguard Worker %tmp19 = getelementptr %struct.list, %struct.list* %tmp22, i32 0, i32 1 ; <%struct.list**> [#uses=1] 71*9880d681SAndroid Build Coastguard Worker %tmp20 = load %struct.list*, %struct.list** %tmp19 ; <%struct.list*> [#uses=1] 72*9880d681SAndroid Build Coastguard Worker store %struct.list* %tmp20, %struct.list** %l 73*9880d681SAndroid Build Coastguard Worker br label %bb21 74*9880d681SAndroid Build Coastguard Worker 75*9880d681SAndroid Build Coastguard Workerbb21: ; preds = %cond_next, %entry 76*9880d681SAndroid Build Coastguard Worker %l.in = phi %struct.list** [ @operators, %entry ], [ %tmp19, %cond_next ] 77*9880d681SAndroid Build Coastguard Worker %tmp22 = load %struct.list*, %struct.list** %l.in ; <%struct.list*> [#uses=1] 78*9880d681SAndroid Build Coastguard Worker icmp ne %struct.list* %tmp22, null ; <i1>:3 [#uses=1] 79*9880d681SAndroid Build Coastguard Worker zext i1 %3 to i8 ; <i8>:4 [#uses=1] 80*9880d681SAndroid Build Coastguard Worker icmp ne i8 %4, 0 ; <i1>:5 [#uses=1] 81*9880d681SAndroid Build Coastguard Worker br i1 %5, label %bb, label %bb23 82*9880d681SAndroid Build Coastguard Worker 83*9880d681SAndroid Build Coastguard Workerbb23: ; preds = %bb21 84*9880d681SAndroid Build Coastguard Worker %tmp24 = load i32, i32* %c ; <i32> [#uses=1] 85*9880d681SAndroid Build Coastguard Worker store i32 %tmp24, i32* %tmp 86*9880d681SAndroid Build Coastguard Worker %tmp25 = load i32, i32* %tmp ; <i32> [#uses=1] 87*9880d681SAndroid Build Coastguard Worker store i32 %tmp25, i32* %retval 88*9880d681SAndroid Build Coastguard Worker br label %return 89*9880d681SAndroid Build Coastguard Worker 90*9880d681SAndroid Build Coastguard Workerreturn: ; preds = %bb23 91*9880d681SAndroid Build Coastguard Worker %retval26 = load i32, i32* %retval ; <i32> [#uses=1] 92*9880d681SAndroid Build Coastguard Worker ret i32 %retval26 93*9880d681SAndroid Build Coastguard Worker} 94*9880d681SAndroid Build Coastguard Worker 95*9880d681SAndroid Build Coastguard Workerdeclare i32 @fprintf(%struct.FILE*, i8*, ...) 96