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