1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=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
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
19 ; CHECK-NEXT: [[USUBO:%[0-9]+]]:_(s32), [[USUBO1:%[0-9]+]]:_(s32) = G_USUBO [[COPY]], [[COPY1]]
20 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
21 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
22 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[USUBO1]], [[C1]]
23 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[C]], [[USUBO]]
24 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
25 ; CHECK-NEXT: RET_ReallyLR implicit $w0
28 %2:_(s32) = G_USUBSAT %0, %1
30 RET_ReallyLR implicit $w0
36 tracksRegLiveness: true
44 ; CHECK-LABEL: name: func2
45 ; CHECK: liveins: $x0, $x1
47 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
48 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
49 ; CHECK-NEXT: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s32) = G_USUBO [[COPY]], [[COPY1]]
50 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
51 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
52 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[USUBO1]], [[C1]]
53 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[AND]](s32), [[C]], [[USUBO]]
54 ; CHECK-NEXT: $x0 = COPY [[SELECT]](s64)
55 ; CHECK-NEXT: RET_ReallyLR implicit $x0
58 %2:_(s64) = G_USUBSAT %0, %1
60 RET_ReallyLR implicit $x0
66 tracksRegLiveness: true
74 ; CHECK-LABEL: name: func16
75 ; CHECK: liveins: $w0, $w1
77 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
78 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
79 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
80 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
81 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
82 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
83 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C]]
84 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
85 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
86 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
87 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
88 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND3]](s32), [[C1]], [[SUB]]
89 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
90 ; CHECK-NEXT: RET_ReallyLR implicit $w0
92 %0:_(s16) = G_TRUNC %2(s32)
94 %1:_(s16) = G_TRUNC %3(s32)
95 %4:_(s16) = G_USUBSAT %0, %1
96 %5:_(s32) = G_ANYEXT %4(s16)
98 RET_ReallyLR implicit $w0
104 tracksRegLiveness: true
112 ; CHECK-LABEL: name: func8
113 ; CHECK: liveins: $w0, $w1
115 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
116 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
117 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
118 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
119 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
120 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
121 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C]]
122 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
123 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
124 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
125 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
126 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND3]](s32), [[C1]], [[SUB]]
127 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
128 ; CHECK-NEXT: 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
153 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
154 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
155 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
156 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
157 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
158 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[AND]], [[AND1]]
159 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C]]
160 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SUB]](s32), [[AND2]]
161 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
162 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
163 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]]
164 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND3]](s32), [[C1]], [[SUB]]
165 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
166 ; CHECK-NEXT: RET_ReallyLR implicit $w0
168 %0:_(s4) = G_TRUNC %2(s32)
170 %1:_(s4) = G_TRUNC %3(s32)
171 %4:_(s4) = G_USUBSAT %0, %1
172 %5:_(s32) = G_ANYEXT %4(s4)
174 RET_ReallyLR implicit $w0