1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -march=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
7 ; CHECK-LABEL: name: test_icmp
8 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
9 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x0
10 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sge), [[COPY]](s64), [[COPY1]]
11 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
12 ; CHECK: $w0 = COPY [[COPY2]](s32)
13 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
14 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
15 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
16 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
17 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]]
18 ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
19 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ICMP1]](s32)
20 ; CHECK: $w0 = COPY [[COPY3]](s32)
21 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s64)
22 ; CHECK: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[INTTOPTR]](p0), [[INTTOPTR]]
23 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ICMP2]](s32)
24 ; CHECK: $w0 = COPY [[COPY4]](s32)
27 %2:_(s8) = G_TRUNC %0(s64)
28 %3:_(s8) = G_TRUNC %1(s64)
29 %4:_(s1) = G_ICMP intpred(sge), %0(s64), %1
30 %11:_(s32) = G_ANYEXT %4(s1)
32 %8:_(s1) = G_ICMP intpred(ult), %2(s8), %3
33 %12:_(s32) = G_ANYEXT %8(s1)
35 %9:_(p0) = G_INTTOPTR %0(s64)
36 %10:_(s1) = G_ICMP intpred(eq), %9(p0), %9
37 %14:_(s32) = G_ANYEXT %10(s1)
44 tracksRegLiveness: true
46 ; CHECK-LABEL: name: test_s128
48 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
49 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
50 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
51 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967296
52 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[DEF]](s64), [[C1]]
53 ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[DEF]](s64), [[C1]]
54 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP1]](s32)
55 ; CHECK: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[DEF]](s64), [[C]]
56 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[ICMP2]](s32)
57 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
58 ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[COPY]], [[COPY1]]
59 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[SELECT]](s32)
60 ; CHECK: G_BRCOND [[TRUNC1]](s1), %bb.1
67 %0:_(s128) = G_IMPLICIT_DEF
68 %1:_(s128) = G_CONSTANT i128 79228162514264337593543950336
69 %3:_(s1) = G_CONSTANT i1 true
70 %2:_(s1) = G_ICMP intpred(ult), %0(s128), %1
71 G_BRCOND %2(s1), %bb.2
84 tracksRegLiveness: true
86 ; CHECK-LABEL: name: test_s128_eq
88 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
89 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
90 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
91 ; CHECK: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[DEF]], [[DEF]]
92 ; CHECK: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[DEF]], [[DEF]]
93 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]]
94 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s64), [[C]]
95 ; CHECK: %cmp:_(s1) = G_TRUNC [[ICMP]](s32)
96 ; CHECK: G_BRCOND %cmp(s1), %bb.1
101 ; CHECK: RET_ReallyLR
103 %lhs:_(s128) = G_IMPLICIT_DEF
104 %rhs:_(s128) = G_IMPLICIT_DEF
105 %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s128), %rhs
106 G_BRCOND %cmp(s1), %bb.2
116 tracksRegLiveness: true
118 ; CHECK-LABEL: name: test_s88_eq
120 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
121 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
122 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
123 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 16777215
124 ; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]]
125 ; CHECK: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]]
126 ; CHECK: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]]
127 ; CHECK: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]]
128 ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
129 ; CHECK: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND2]]
130 ; CHECK: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND3]]
131 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]]
132 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s64), [[C2]]
133 ; CHECK: %cmp:_(s1) = G_TRUNC [[ICMP]](s32)
134 ; CHECK: G_BRCOND %cmp(s1), %bb.1
139 ; CHECK: RET_ReallyLR
141 %lhs:_(s88) = G_IMPLICIT_DEF
142 %rhs:_(s88) = G_IMPLICIT_DEF
143 %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s88), %rhs
144 G_BRCOND %cmp(s1), %bb.2
154 tracksRegLiveness: true
156 ; CHECK-LABEL: name: test_s88_ne
158 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
159 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
160 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
161 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 16777215
162 ; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]]
163 ; CHECK: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]]
164 ; CHECK: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]]
165 ; CHECK: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]]
166 ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
167 ; CHECK: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND2]]
168 ; CHECK: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND3]]
169 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]]
170 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[OR]](s64), [[C2]]
171 ; CHECK: %cmp:_(s1) = G_TRUNC [[ICMP]](s32)
172 ; CHECK: G_BRCOND %cmp(s1), %bb.1
177 ; CHECK: RET_ReallyLR
179 %lhs:_(s88) = G_IMPLICIT_DEF
180 %rhs:_(s88) = G_IMPLICIT_DEF
181 %cmp:_(s1) = G_ICMP intpred(ne), %lhs(s88), %rhs
182 G_BRCOND %cmp(s1), %bb.2
192 tracksRegLiveness: true
194 ; CHECK-LABEL: name: test_s96_eq
196 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
197 ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
198 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
199 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
200 ; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]]
201 ; CHECK: [[AND1:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]]
202 ; CHECK: [[AND2:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C]]
203 ; CHECK: [[AND3:%[0-9]+]]:_(s64) = G_AND [[DEF]], [[C1]]
204 ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
205 ; CHECK: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[AND]], [[AND2]]
206 ; CHECK: [[XOR1:%[0-9]+]]:_(s64) = G_XOR [[AND1]], [[AND3]]
207 ; CHECK: [[OR:%[0-9]+]]:_(s64) = G_OR [[XOR]], [[XOR1]]
208 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s64), [[C2]]
209 ; CHECK: %cmp:_(s1) = G_TRUNC [[ICMP]](s32)
210 ; CHECK: G_BRCOND %cmp(s1), %bb.1
215 ; CHECK: RET_ReallyLR
217 %lhs:_(s96) = G_IMPLICIT_DEF
218 %rhs:_(s96) = G_IMPLICIT_DEF
219 %cmp:_(s1) = G_ICMP intpred(eq), %lhs(s96), %rhs
220 G_BRCOND %cmp(s1), %bb.2