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
6 tracksRegLiveness: true
14 ; CHECK-LABEL: name: func
15 ; CHECK: liveins: $w0, $w1
16 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
17 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
18 ; CHECK: [[USUBO:%[0-9]+]]:_(s32), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[COPY]], [[COPY1]]
19 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
20 ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[USUBO1]](s1), [[C]], [[USUBO]]
21 ; CHECK: $w0 = COPY [[SELECT]](s32)
22 ; CHECK: RET_ReallyLR implicit $w0
25 %2:_(s32) = G_USUBSAT %0, %1
27 RET_ReallyLR implicit $w0
33 tracksRegLiveness: true
41 ; CHECK-LABEL: name: func2
42 ; CHECK: liveins: $x0, $x1
43 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
44 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
45 ; CHECK: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[COPY]], [[COPY1]]
46 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
47 ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[USUBO1]](s1), [[C]], [[USUBO]]
48 ; CHECK: $x0 = COPY [[SELECT]](s64)
49 ; CHECK: RET_ReallyLR implicit $x0
52 %2:_(s64) = G_USUBSAT %0, %1
54 RET_ReallyLR implicit $x0
60 tracksRegLiveness: true
68 ; CHECK-LABEL: name: func16
69 ; CHECK: liveins: $w0, $w1
70 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
71 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
72 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
73 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
74 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
75 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
76 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
77 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
78 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
79 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
80 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
81 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
82 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
83 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
84 ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[C1]], [[COPY5]]
85 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
86 ; CHECK: $w0 = COPY [[COPY6]](s32)
87 ; CHECK: RET_ReallyLR implicit $w0
89 %0:_(s16) = G_TRUNC %2(s32)
91 %1:_(s16) = G_TRUNC %3(s32)
92 %4:_(s16) = G_USUBSAT %0, %1
93 %5:_(s32) = G_ANYEXT %4(s16)
95 RET_ReallyLR implicit $w0
101 tracksRegLiveness: true
109 ; CHECK-LABEL: name: func8
110 ; CHECK: liveins: $w0, $w1
111 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
112 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
113 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
114 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
115 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
116 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
117 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
118 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
119 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
120 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
121 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
122 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
123 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
124 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
125 ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[C1]], [[COPY5]]
126 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
127 ; CHECK: $w0 = COPY [[COPY6]](s32)
128 ; CHECK: RET_ReallyLR implicit $w0
130 %0:_(s8) = G_TRUNC %2(s32)
132 %1:_(s8) = G_TRUNC %3(s32)
133 %4:_(s8) = G_USUBSAT %0, %1
134 %5:_(s32) = G_ANYEXT %4(s8)
136 RET_ReallyLR implicit $w0
142 tracksRegLiveness: true
150 ; CHECK-LABEL: name: func3
151 ; CHECK: liveins: $w0, $w1
152 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
153 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
154 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
155 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
156 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
157 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
158 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
159 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
160 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
161 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
162 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
163 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
164 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
165 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
166 ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[C1]], [[COPY5]]
167 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
168 ; CHECK: $w0 = COPY [[COPY6]](s32)
169 ; CHECK: RET_ReallyLR implicit $w0
171 %0:_(s4) = G_TRUNC %2(s32)
173 %1:_(s4) = G_TRUNC %3(s32)
174 %4:_(s4) = G_USUBSAT %0, %1
175 %5:_(s32) = G_ANYEXT %4(s4)
177 RET_ReallyLR implicit $w0