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: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s32) = G_UADDO [[COPY]], [[COPY1]]
20 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
21 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
22 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UADDO1]], [[C1]]
23 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[C]], [[UADDO]]
24 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
25 ; CHECK-NEXT: RET_ReallyLR implicit $w0
28 %2:_(s32) = G_UADDSAT %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: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s32) = G_UADDO [[COPY]], [[COPY1]]
50 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
51 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
52 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[UADDO1]], [[C1]]
53 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[AND]](s32), [[C]], [[UADDO]]
54 ; CHECK-NEXT: $x0 = COPY [[SELECT]](s64)
55 ; CHECK-NEXT: RET_ReallyLR implicit $x0
58 %2:_(s64) = G_UADDSAT %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: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
83 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
84 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
85 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
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]], [[ADD]]
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_UADDSAT %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: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
121 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
122 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
123 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
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]], [[ADD]]
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_UADDSAT %0, %1
134 %5:_(s32) = G_ANYEXT %4(s8)
136 RET_ReallyLR implicit $w0
142 tracksRegLiveness: true
148 machineFunctionInfo: {}
153 ; CHECK-LABEL: name: func3
154 ; CHECK: liveins: $w0, $w1
156 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
157 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
158 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
159 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
160 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
161 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
162 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
163 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
164 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[C]](s32)
165 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
166 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]]
167 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND3]](s32), [[COPY2]], [[ADD]]
168 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
169 ; CHECK-NEXT: RET_ReallyLR implicit $w0
171 %0:_(s4) = G_TRUNC %2(s32)
173 %1:_(s4) = G_TRUNC %3(s32)
174 %4:_(s4) = G_UADDSAT %0, %1
175 %5:_(s32) = G_ANYEXT %4(s4)
177 RET_ReallyLR implicit $w0