1 ; RUN: opt < %s -gvn -simplifycfg -disable-output 2 ; PR867 3 4 target datalayout = "E-p:32:32" 5 target triple = "powerpc-apple-darwin8" 6 %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } 7 %struct.eh_status = type opaque 8 %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** } 9 %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* } 10 %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, i32, %struct.var_refs_queue*, i32, i32, %struct.rtvec_def*, %struct.tree_node*, i32, i32, i32, %struct.machine_function*, i32, i32, i8, i8, %struct.language_function*, %struct.rtx_def*, i32, i32, i32, i32, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, i8, i8, i8 } 11 %struct.initial_value_struct = type opaque 12 %struct.lang_decl = type opaque 13 %struct.lang_type = type opaque 14 %struct.language_function = type opaque 15 %struct.location_t = type { i8*, i32 } 16 %struct.machine_function = type { i32, i32, i8*, i32, i32 } 17 %struct.rtunion = type { i32 } 18 %struct.rtvec_def = type { i32, [1 x %struct.rtx_def*] } 19 %struct.rtx_def = type { i16, i8, i8, %struct.u } 20 %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* } 21 %struct.temp_slot = type opaque 22 %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 } 23 %struct.tree_decl = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, i8, i8, i8, i8, i8, i8, i8, i8, i32, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* } 24 %struct.tree_decl_u1 = type { i64 } 25 %struct.tree_decl_u2 = type { %struct.function* } 26 %struct.tree_node = type { %struct.tree_decl } 27 %struct.tree_type = type { %struct.tree_common, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i32, i16, i8, i8, i32, %struct.tree_node*, %struct.tree_node*, %struct.rtunion, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_type* } 28 %struct.u = type { [1 x i64] } 29 %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* } 30 %struct.varasm_status = type opaque 31 %struct.varray_head_tag = type { i32, i32, i32, i8*, %struct.u } 32 %union.tree_ann_d = type opaque 33 @mode_class = external global [35 x i8] ; <[35 x i8]*> [#uses=3] 34 35 define void @fold_builtin_classify() { 36 entry: 37 %tmp63 = load i32* null ; <i32> [#uses=1] 38 switch i32 %tmp63, label %bb276 [ 39 i32 414, label %bb145 40 i32 417, label %bb 41 ] 42 bb: ; preds = %entry 43 ret void 44 bb145: ; preds = %entry 45 %tmp146 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] 46 %tmp148 = getelementptr %struct.tree_node* %tmp146, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] 47 %tmp149 = load %struct.tree_node** %tmp148 ; <%struct.tree_node*> [#uses=1] 48 %tmp150 = bitcast %struct.tree_node* %tmp149 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] 49 %tmp151 = getelementptr %struct.tree_type* %tmp150, i32 0, i32 6 ; <i16*> [#uses=1] 50 %tmp151.upgrd.1 = bitcast i16* %tmp151 to i32* ; <i32*> [#uses=1] 51 %tmp152 = load i32* %tmp151.upgrd.1 ; <i32> [#uses=1] 52 %tmp154 = lshr i32 %tmp152, 16 ; <i32> [#uses=1] 53 %tmp154.mask = and i32 %tmp154, 127 ; <i32> [#uses=1] 54 %gep.upgrd.2 = zext i32 %tmp154.mask to i64 ; <i64> [#uses=1] 55 %tmp155 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.2 ; <i8*> [#uses=1] 56 %tmp156 = load i8* %tmp155 ; <i8> [#uses=1] 57 %tmp157 = icmp eq i8 %tmp156, 4 ; <i1> [#uses=1] 58 br i1 %tmp157, label %cond_next241, label %cond_true158 59 cond_true158: ; preds = %bb145 60 %tmp172 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] 61 %tmp174 = getelementptr %struct.tree_node* %tmp172, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] 62 %tmp175 = load %struct.tree_node** %tmp174 ; <%struct.tree_node*> [#uses=1] 63 %tmp176 = bitcast %struct.tree_node* %tmp175 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] 64 %tmp177 = getelementptr %struct.tree_type* %tmp176, i32 0, i32 6 ; <i16*> [#uses=1] 65 %tmp177.upgrd.3 = bitcast i16* %tmp177 to i32* ; <i32*> [#uses=1] 66 %tmp178 = load i32* %tmp177.upgrd.3 ; <i32> [#uses=1] 67 %tmp180 = lshr i32 %tmp178, 16 ; <i32> [#uses=1] 68 %tmp180.mask = and i32 %tmp180, 127 ; <i32> [#uses=1] 69 %gep.upgrd.4 = zext i32 %tmp180.mask to i64 ; <i64> [#uses=1] 70 %tmp181 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.4 ; <i8*> [#uses=1] 71 %tmp182 = load i8* %tmp181 ; <i8> [#uses=1] 72 %tmp183 = icmp eq i8 %tmp182, 8 ; <i1> [#uses=1] 73 br i1 %tmp183, label %cond_next241, label %cond_true184 74 cond_true184: ; preds = %cond_true158 75 %tmp185 = load %struct.tree_node** null ; <%struct.tree_node*> [#uses=1] 76 %tmp187 = getelementptr %struct.tree_node* %tmp185, i32 0, i32 0, i32 0, i32 1 ; <%struct.tree_node**> [#uses=1] 77 %tmp188 = load %struct.tree_node** %tmp187 ; <%struct.tree_node*> [#uses=1] 78 %tmp189 = bitcast %struct.tree_node* %tmp188 to %struct.tree_type* ; <%struct.tree_type*> [#uses=1] 79 %tmp190 = getelementptr %struct.tree_type* %tmp189, i32 0, i32 6 ; <i16*> [#uses=1] 80 %tmp190.upgrd.5 = bitcast i16* %tmp190 to i32* ; <i32*> [#uses=1] 81 %tmp191 = load i32* %tmp190.upgrd.5 ; <i32> [#uses=1] 82 %tmp193 = lshr i32 %tmp191, 16 ; <i32> [#uses=1] 83 %tmp193.mask = and i32 %tmp193, 127 ; <i32> [#uses=1] 84 %gep.upgrd.6 = zext i32 %tmp193.mask to i64 ; <i64> [#uses=1] 85 %tmp194 = getelementptr [35 x i8]* @mode_class, i32 0, i64 %gep.upgrd.6 ; <i8*> [#uses=1] 86 %tmp195 = load i8* %tmp194 ; <i8> [#uses=1] 87 %tmp196 = icmp eq i8 %tmp195, 4 ; <i1> [#uses=1] 88 br i1 %tmp196, label %cond_next241, label %cond_true197 89 cond_true197: ; preds = %cond_true184 90 ret void 91 cond_next241: ; preds = %cond_true184, %cond_true158, %bb145 92 %tmp245 = load i32* null ; <i32> [#uses=0] 93 ret void 94 bb276: ; preds = %entry 95 ret void 96 } 97