1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=regbankselect -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define i32 @mod4_0_to_11(i32 %a) {
7 switch i32 %a, label %sw.default [
18 sw.bb: ; preds = %entry, %entry
21 sw.bb1: ; preds = %entry, %entry
24 sw.bb2: ; preds = %entry, %entry
27 sw.bb3: ; preds = %entry, %entry
30 sw.default: ; preds = %entry
33 sw.epilog: ; preds = %sw.default
34 switch i32 %a, label %sw.default8 [
41 sw.bb4: ; preds = %sw.epilog
44 sw.bb5: ; preds = %sw.epilog
47 sw.bb6: ; preds = %sw.epilog
50 sw.bb7: ; preds = %sw.epilog
53 sw.default8: ; preds = %sw.epilog
62 tracksRegLiveness: true
67 blocks: [ '%bb.2', '%bb.3', '%bb.4', '%bb.5', '%bb.2', '%bb.3',
70 blocks: [ '%bb.8', '%bb.9', '%bb.10', '%bb.11' ]
72 ; MIPS32-LABEL: name: mod4_0_to_11
74 ; MIPS32: successors: %bb.6(0x40000000), %bb.1(0x40000000)
75 ; MIPS32: liveins: $a0
76 ; MIPS32: [[COPY:%[0-9]+]]:gprb(s32) = COPY $a0
77 ; MIPS32: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 7
78 ; MIPS32: [[C1:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 3
79 ; MIPS32: [[C2:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 2
80 ; MIPS32: [[C3:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
81 ; MIPS32: [[C4:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 0
82 ; MIPS32: [[C5:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 -1
83 ; MIPS32: [[C6:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 0
84 ; MIPS32: [[SUB:%[0-9]+]]:gprb(s32) = G_SUB [[COPY]], [[C6]]
85 ; MIPS32: [[COPY1:%[0-9]+]]:gprb(s32) = COPY [[SUB]](s32)
86 ; MIPS32: [[COPY2:%[0-9]+]]:gprb(s32) = COPY [[C]](s32)
87 ; MIPS32: [[ICMP:%[0-9]+]]:gprb(s32) = G_ICMP intpred(ugt), [[COPY1]](s32), [[COPY2]]
88 ; MIPS32: [[COPY3:%[0-9]+]]:gprb(s32) = COPY [[ICMP]](s32)
89 ; MIPS32: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY3]], [[C3]]
90 ; MIPS32: G_BRCOND [[AND]](s32), %bb.6
92 ; MIPS32: successors: %bb.2(0x20000000), %bb.3(0x20000000), %bb.4(0x20000000), %bb.5(0x20000000)
93 ; MIPS32: [[JUMP_TABLE:%[0-9]+]]:gprb(p0) = G_JUMP_TABLE %jump-table.0
94 ; MIPS32: G_BRJT [[JUMP_TABLE]](p0), %jump-table.0, [[COPY1]](s32)
96 ; MIPS32: $v0 = COPY [[C4]](s32)
97 ; MIPS32: RetRA implicit $v0
98 ; MIPS32: bb.3.sw.bb1:
99 ; MIPS32: $v0 = COPY [[C3]](s32)
100 ; MIPS32: RetRA implicit $v0
101 ; MIPS32: bb.4.sw.bb2:
102 ; MIPS32: $v0 = COPY [[C2]](s32)
103 ; MIPS32: RetRA implicit $v0
104 ; MIPS32: bb.5.sw.bb3:
105 ; MIPS32: $v0 = COPY [[C1]](s32)
106 ; MIPS32: RetRA implicit $v0
107 ; MIPS32: bb.6.sw.default:
108 ; MIPS32: successors: %bb.7(0x80000000)
109 ; MIPS32: bb.7.sw.epilog:
110 ; MIPS32: successors: %bb.13(0x40000000), %bb.8(0x40000000)
111 ; MIPS32: [[C7:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 8
112 ; MIPS32: [[SUB1:%[0-9]+]]:gprb(s32) = G_SUB [[COPY]], [[C7]]
113 ; MIPS32: [[COPY4:%[0-9]+]]:gprb(s32) = COPY [[SUB1]](s32)
114 ; MIPS32: [[COPY5:%[0-9]+]]:gprb(s32) = COPY [[C1]](s32)
115 ; MIPS32: [[ICMP1:%[0-9]+]]:gprb(s32) = G_ICMP intpred(ugt), [[COPY4]](s32), [[COPY5]]
116 ; MIPS32: [[C8:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
117 ; MIPS32: [[COPY6:%[0-9]+]]:gprb(s32) = COPY [[ICMP1]](s32)
118 ; MIPS32: [[AND1:%[0-9]+]]:gprb(s32) = G_AND [[COPY6]], [[C8]]
119 ; MIPS32: G_BRCOND [[AND1]](s32), %bb.13
120 ; MIPS32: bb.8.sw.epilog:
121 ; MIPS32: successors: %bb.9(0x20000000), %bb.10(0x20000000), %bb.11(0x20000000), %bb.12(0x20000000)
122 ; MIPS32: [[JUMP_TABLE1:%[0-9]+]]:gprb(p0) = G_JUMP_TABLE %jump-table.1
123 ; MIPS32: G_BRJT [[JUMP_TABLE1]](p0), %jump-table.1, [[COPY4]](s32)
124 ; MIPS32: bb.9.sw.bb4:
125 ; MIPS32: $v0 = COPY [[C4]](s32)
126 ; MIPS32: RetRA implicit $v0
127 ; MIPS32: bb.10.sw.bb5:
128 ; MIPS32: $v0 = COPY [[C3]](s32)
129 ; MIPS32: RetRA implicit $v0
130 ; MIPS32: bb.11.sw.bb6:
131 ; MIPS32: $v0 = COPY [[C2]](s32)
132 ; MIPS32: RetRA implicit $v0
133 ; MIPS32: bb.12.sw.bb7:
134 ; MIPS32: $v0 = COPY [[C1]](s32)
135 ; MIPS32: RetRA implicit $v0
136 ; MIPS32: bb.13.sw.default8:
137 ; MIPS32: $v0 = COPY [[C5]](s32)
138 ; MIPS32: RetRA implicit $v0
143 %4:_(s32) = G_CONSTANT i32 7
144 %8:_(s32) = G_CONSTANT i32 3
145 %9:_(s32) = G_CONSTANT i32 2
146 %10:_(s32) = G_CONSTANT i32 1
147 %11:_(s32) = G_CONSTANT i32 0
148 %18:_(s32) = G_CONSTANT i32 -1
149 %1:_(s32) = G_CONSTANT i32 0
150 %2:_(s32) = G_SUB %0, %1
151 %3:_(s32) = COPY %2(s32)
152 %5:_(s32) = COPY %4(s32)
153 %22:_(s32) = G_ICMP intpred(ugt), %3(s32), %5
154 %23:_(s32) = COPY %22(s32)
155 %21:_(s32) = G_AND %23, %10
156 G_BRCOND %21(s32), %bb.6
159 successors: %bb.2, %bb.3, %bb.4, %bb.5
161 %7:_(p0) = G_JUMP_TABLE %jump-table.0
162 G_BRJT %7(p0), %jump-table.0, %3(s32)
183 %12:_(s32) = G_CONSTANT i32 8
184 %13:_(s32) = G_SUB %0, %12
185 %14:_(s32) = COPY %13(s32)
186 %15:_(s32) = COPY %8(s32)
187 %20:_(s32) = G_ICMP intpred(ugt), %14(s32), %15
188 %24:_(s32) = G_CONSTANT i32 1
189 %25:_(s32) = COPY %20(s32)
190 %19:_(s32) = G_AND %25, %24
191 G_BRCOND %19(s32), %bb.12
194 successors: %bb.8, %bb.9, %bb.10, %bb.11
196 %17:_(p0) = G_JUMP_TABLE %jump-table.1
197 G_BRJT %17(p0), %jump-table.1, %14(s32)