Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / CodeGen / Mips / GlobalISel / legalizer / icmp.mir
blob7f0196f90226704d09f4b6d49ea3a909188d9d23
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
3 --- |
5   define void @eq() {entry: ret void}
6   define void @ne() {entry: ret void}
7   define void @sgt() {entry: ret void}
8   define void @sge() {entry: ret void}
9   define void @slt() {entry: ret void}
10   define void @sle() {entry: ret void}
11   define void @ugt() {entry: ret void}
12   define void @uge() {entry: ret void}
13   define void @ult() {entry: ret void}
14   define void @ule() {entry: ret void}
16 ...
17 ---
18 name:            eq
19 alignment:       2
20 tracksRegLiveness: true
21 body:             |
22   bb.1.entry:
23     liveins: $a0, $a1
25     ; MIPS32-LABEL: name: eq
26     ; MIPS32: liveins: $a0, $a1
27     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
28     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
29     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
30     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
31     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
32     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
33     ; MIPS32: $v0 = COPY [[AND]](s32)
34     ; MIPS32: RetRA implicit $v0
35     %0:_(s32) = COPY $a0
36     %1:_(s32) = COPY $a1
37     %2:_(s1) = G_ICMP intpred(eq), %0(s32), %1
38     %3:_(s32) = G_ZEXT %2(s1)
39     $v0 = COPY %3(s32)
40     RetRA implicit $v0
42 ...
43 ---
44 name:            ne
45 alignment:       2
46 tracksRegLiveness: true
47 body:             |
48   bb.1.entry:
49     liveins: $a0, $a1
51     ; MIPS32-LABEL: name: ne
52     ; MIPS32: liveins: $a0, $a1
53     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
54     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
55     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
56     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
57     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
58     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
59     ; MIPS32: $v0 = COPY [[AND]](s32)
60     ; MIPS32: RetRA implicit $v0
61     %0:_(s32) = COPY $a0
62     %1:_(s32) = COPY $a1
63     %2:_(s1) = G_ICMP intpred(ne), %0(s32), %1
64     %3:_(s32) = G_ZEXT %2(s1)
65     $v0 = COPY %3(s32)
66     RetRA implicit $v0
68 ...
69 ---
70 name:            sgt
71 alignment:       2
72 tracksRegLiveness: true
73 body:             |
74   bb.1.entry:
75     liveins: $a0, $a1
77     ; MIPS32-LABEL: name: sgt
78     ; MIPS32: liveins: $a0, $a1
79     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
80     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
81     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY]](s32), [[COPY1]]
82     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
83     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
84     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
85     ; MIPS32: $v0 = COPY [[AND]](s32)
86     ; MIPS32: RetRA implicit $v0
87     %0:_(s32) = COPY $a0
88     %1:_(s32) = COPY $a1
89     %2:_(s1) = G_ICMP intpred(sgt), %0(s32), %1
90     %3:_(s32) = G_ZEXT %2(s1)
91     $v0 = COPY %3(s32)
92     RetRA implicit $v0
94 ...
95 ---
96 name:            sge
97 alignment:       2
98 tracksRegLiveness: true
99 body:             |
100   bb.1.entry:
101     liveins: $a0, $a1
103     ; MIPS32-LABEL: name: sge
104     ; MIPS32: liveins: $a0, $a1
105     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
106     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
107     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sge), [[COPY]](s32), [[COPY1]]
108     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
109     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
110     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
111     ; MIPS32: $v0 = COPY [[AND]](s32)
112     ; MIPS32: RetRA implicit $v0
113     %0:_(s32) = COPY $a0
114     %1:_(s32) = COPY $a1
115     %2:_(s1) = G_ICMP intpred(sge), %0(s32), %1
116     %3:_(s32) = G_ZEXT %2(s1)
117     $v0 = COPY %3(s32)
118     RetRA implicit $v0
122 name:            slt
123 alignment:       2
124 tracksRegLiveness: true
125 body:             |
126   bb.1.entry:
127     liveins: $a0, $a1
129     ; MIPS32-LABEL: name: slt
130     ; MIPS32: liveins: $a0, $a1
131     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
132     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
133     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY]](s32), [[COPY1]]
134     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
135     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
136     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
137     ; MIPS32: $v0 = COPY [[AND]](s32)
138     ; MIPS32: RetRA implicit $v0
139     %0:_(s32) = COPY $a0
140     %1:_(s32) = COPY $a1
141     %2:_(s1) = G_ICMP intpred(slt), %0(s32), %1
142     %3:_(s32) = G_ZEXT %2(s1)
143     $v0 = COPY %3(s32)
144     RetRA implicit $v0
148 name:            sle
149 alignment:       2
150 tracksRegLiveness: true
151 body:             |
152   bb.1.entry:
153     liveins: $a0, $a1
155     ; MIPS32-LABEL: name: sle
156     ; MIPS32: liveins: $a0, $a1
157     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
158     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
159     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sle), [[COPY]](s32), [[COPY1]]
160     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
161     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
162     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
163     ; MIPS32: $v0 = COPY [[AND]](s32)
164     ; MIPS32: RetRA implicit $v0
165     %0:_(s32) = COPY $a0
166     %1:_(s32) = COPY $a1
167     %2:_(s1) = G_ICMP intpred(sle), %0(s32), %1
168     %3:_(s32) = G_ZEXT %2(s1)
169     $v0 = COPY %3(s32)
170     RetRA implicit $v0
174 name:            ugt
175 alignment:       2
176 tracksRegLiveness: true
177 body:             |
178   bb.1.entry:
179     liveins: $a0, $a1
181     ; MIPS32-LABEL: name: ugt
182     ; MIPS32: liveins: $a0, $a1
183     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
184     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
185     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY1]]
186     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
187     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
188     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
189     ; MIPS32: $v0 = COPY [[AND]](s32)
190     ; MIPS32: RetRA implicit $v0
191     %0:_(s32) = COPY $a0
192     %1:_(s32) = COPY $a1
193     %2:_(s1) = G_ICMP intpred(ugt), %0(s32), %1
194     %3:_(s32) = G_ZEXT %2(s1)
195     $v0 = COPY %3(s32)
196     RetRA implicit $v0
200 name:            uge
201 alignment:       2
202 tracksRegLiveness: true
203 body:             |
204   bb.1.entry:
205     liveins: $a0, $a1
207     ; MIPS32-LABEL: name: uge
208     ; MIPS32: liveins: $a0, $a1
209     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
210     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
211     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY]](s32), [[COPY1]]
212     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
213     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
214     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
215     ; MIPS32: $v0 = COPY [[AND]](s32)
216     ; MIPS32: RetRA implicit $v0
217     %0:_(s32) = COPY $a0
218     %1:_(s32) = COPY $a1
219     %2:_(s1) = G_ICMP intpred(uge), %0(s32), %1
220     %3:_(s32) = G_ZEXT %2(s1)
221     $v0 = COPY %3(s32)
222     RetRA implicit $v0
226 name:            ult
227 alignment:       2
228 tracksRegLiveness: true
229 body:             |
230   bb.1.entry:
231     liveins: $a0, $a1
233     ; MIPS32-LABEL: name: ult
234     ; MIPS32: liveins: $a0, $a1
235     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
236     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
237     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY1]]
238     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
239     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
240     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
241     ; MIPS32: $v0 = COPY [[AND]](s32)
242     ; MIPS32: RetRA implicit $v0
243     %0:_(s32) = COPY $a0
244     %1:_(s32) = COPY $a1
245     %2:_(s1) = G_ICMP intpred(ult), %0(s32), %1
246     %3:_(s32) = G_ZEXT %2(s1)
247     $v0 = COPY %3(s32)
248     RetRA implicit $v0
252 name:            ule
253 alignment:       2
254 tracksRegLiveness: true
255 body:             |
256   bb.1.entry:
257     liveins: $a0, $a1
259     ; MIPS32-LABEL: name: ule
260     ; MIPS32: liveins: $a0, $a1
261     ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
262     ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
263     ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY]](s32), [[COPY1]]
264     ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
265     ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
266     ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
267     ; MIPS32: $v0 = COPY [[AND]](s32)
268     ; MIPS32: RetRA implicit $v0
269     %0:_(s32) = COPY $a0
270     %1:_(s32) = COPY $a1
271     %2:_(s1) = G_ICMP intpred(ule), %0(s32), %1
272     %3:_(s32) = G_ZEXT %2(s1)
273     $v0 = COPY %3(s32)
274     RetRA implicit $v0