1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -verify-machineinstrs -mtriple aarch64-unknown-uknown -global-isel-abort=1 -run-pass=instruction-select %s -o - | FileCheck %s
9 tracksRegLiveness: true
14 ; CHECK-LABEL: name: ssube_s64
15 ; CHECK: liveins: $x0, $x1
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
19 ; CHECK-NEXT: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 1
20 ; CHECK-NEXT: [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr $wzr, [[MOVi32imm]], implicit-def $nzcv
21 ; CHECK-NEXT: [[SBCSXr:%[0-9]+]]:gpr64 = SBCSXr [[COPY]], [[COPY1]], implicit-def $nzcv, implicit $nzcv
22 ; CHECK-NEXT: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 7, implicit $nzcv
23 ; CHECK-NEXT: $x0 = COPY [[SBCSXr]]
24 ; CHECK-NEXT: $w1 = COPY [[CSINCWr]]
25 ; CHECK-NEXT: RET_ReallyLR implicit $x0, implicit $w1
26 %0:gpr(s64) = COPY $x0
27 %1:gpr(s64) = COPY $x1
28 %2:gpr(s32) = G_CONSTANT i32 1
29 %3:gpr(s64), %4:gpr(s32) = G_SSUBE %0, %1, %2
32 RET_ReallyLR implicit $x0, implicit $w1
40 tracksRegLiveness: true
45 ; CHECK-LABEL: name: ssube_s32
46 ; CHECK: liveins: $w0, $w1
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
49 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
50 ; CHECK-NEXT: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 1
51 ; CHECK-NEXT: [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr $wzr, [[MOVi32imm]], implicit-def $nzcv
52 ; CHECK-NEXT: [[SBCSWr:%[0-9]+]]:gpr32 = SBCSWr [[COPY]], [[COPY1]], implicit-def $nzcv, implicit $nzcv
53 ; CHECK-NEXT: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 7, implicit $nzcv
54 ; CHECK-NEXT: $w0 = COPY [[SBCSWr]]
55 ; CHECK-NEXT: $w1 = COPY [[CSINCWr]]
56 ; CHECK-NEXT: RET_ReallyLR implicit $w0, implicit $w1
57 %0:gpr(s32) = COPY $w0
58 %1:gpr(s32) = COPY $w1
59 %2:gpr(s32) = G_CONSTANT i32 1
60 %3:gpr(s32), %4:gpr(s32) = G_SSUBE %0, %1, %2
63 RET_ReallyLR implicit $w0, implicit $w1
67 name: ssube_opt_prev_usubo
71 tracksRegLiveness: true
74 liveins: $x0, $x1, $x2, $x3
76 ; CHECK-LABEL: name: ssube_opt_prev_usubo
77 ; CHECK: liveins: $x0, $x1, $x2, $x3
79 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
80 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
81 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
82 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY $x3
83 ; CHECK-NEXT: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr [[COPY]], [[COPY2]], implicit-def $nzcv
84 ; CHECK-NEXT: [[SBCSXr:%[0-9]+]]:gpr64 = SBCSXr [[COPY1]], [[COPY3]], implicit-def $nzcv, implicit $nzcv
85 ; CHECK-NEXT: $x0 = COPY [[SUBSXrr]]
86 ; CHECK-NEXT: $x1 = COPY [[SBCSXr]]
87 ; CHECK-NEXT: RET_ReallyLR implicit $x0, implicit $x1
88 %0:gpr(s64) = COPY $x0
89 %1:gpr(s64) = COPY $x1
90 %2:gpr(s64) = COPY $x2
91 %3:gpr(s64) = COPY $x3
92 %8:gpr(s64), %12:gpr(s32) = G_USUBO %0, %2
93 %9:gpr(s64), %13:gpr(s32) = G_SSUBE %1, %3, %12
96 RET_ReallyLR implicit $x0, implicit $x1
100 name: ssube_opt_prev_usube
103 regBankSelected: true
104 tracksRegLiveness: true
107 liveins: $x0, $x1, $x2, $x3
109 ; CHECK-LABEL: name: ssube_opt_prev_usube
110 ; CHECK: liveins: $x0, $x1, $x2, $x3
112 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
113 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
114 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
115 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY $x3
116 ; CHECK-NEXT: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 1
117 ; CHECK-NEXT: [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr $wzr, [[MOVi32imm]], implicit-def $nzcv
118 ; CHECK-NEXT: [[SBCSXr:%[0-9]+]]:gpr64 = SBCSXr [[COPY]], [[COPY2]], implicit-def $nzcv, implicit $nzcv
119 ; CHECK-NEXT: [[SBCSXr1:%[0-9]+]]:gpr64 = SBCSXr [[COPY1]], [[COPY3]], implicit-def $nzcv, implicit $nzcv
120 ; CHECK-NEXT: $x0 = COPY [[SBCSXr]]
121 ; CHECK-NEXT: $x1 = COPY [[SBCSXr1]]
122 ; CHECK-NEXT: RET_ReallyLR implicit $x0, implicit $x1
123 %0:gpr(s64) = COPY $x0
124 %1:gpr(s64) = COPY $x1
125 %2:gpr(s64) = COPY $x2
126 %3:gpr(s64) = COPY $x3
127 %6:gpr(s32) = G_CONSTANT i32 1
128 %8:gpr(s64), %12:gpr(s32) = G_USUBE %0, %2, %6
129 %9:gpr(s64), %13:gpr(s32) = G_SSUBE %1, %3, %12
132 RET_ReallyLR implicit $x0, implicit $x1
136 name: ssube_opt_bail_clobber
139 regBankSelected: true
140 tracksRegLiveness: true
143 liveins: $x0, $x1, $x2, $x4, $x5, $x6
145 ; CHECK-LABEL: name: ssube_opt_bail_clobber
146 ; CHECK: liveins: $x0, $x1, $x2, $x4, $x5, $x6
148 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
149 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
150 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
151 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY $x4
152 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:gpr64 = COPY $x5
153 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:gpr64 = COPY $x6
154 ; CHECK-NEXT: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr [[COPY]], [[COPY3]], implicit-def $nzcv
155 ; CHECK-NEXT: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 2, implicit $nzcv
156 ; CHECK-NEXT: [[SBCSXr:%[0-9]+]]:gpr64 = SBCSXr [[COPY1]], [[COPY4]], implicit-def $nzcv, implicit $nzcv
157 ; CHECK-NEXT: [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr $wzr, [[CSINCWr]], implicit-def $nzcv
158 ; CHECK-NEXT: [[SBCSXr1:%[0-9]+]]:gpr64 = SBCSXr [[COPY2]], [[COPY5]], implicit-def $nzcv, implicit $nzcv
159 ; CHECK-NEXT: $x0 = COPY [[SUBSXrr]]
160 ; CHECK-NEXT: $x1 = COPY [[SBCSXr]]
161 ; CHECK-NEXT: $x2 = COPY [[SBCSXr1]]
162 ; CHECK-NEXT: RET_ReallyLR implicit $x0, implicit $x1, implicit $x2
163 %0:gpr(s64) = COPY $x0
164 %1:gpr(s64) = COPY $x1
165 %2:gpr(s64) = COPY $x2
166 %4:gpr(s64) = COPY $x4
167 %5:gpr(s64) = COPY $x5
168 %6:gpr(s64) = COPY $x6
169 %7:gpr(s64), %11:gpr(s32) = G_USUBO %0, %4
170 %8:gpr(s64), %12:gpr(s32) = G_USUBE %1, %5, %11
171 ; carry-in is not produced by previous instruction
172 %9:gpr(s64), %13:gpr(s32) = G_SSUBE %2, %6, %11
176 RET_ReallyLR implicit $x0, implicit $x1, implicit $x2
180 name: ssube_opt_prev_dead
183 regBankSelected: true
184 tracksRegLiveness: true
187 liveins: $x0, $x1, $x2, $x3
188 ; CHECK-LABEL: name: ssube_opt_prev_dead
189 ; CHECK: liveins: $x0, $x1, $x2, $x3
191 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
192 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
193 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr64 = COPY $x2
194 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr64 = COPY $x3
195 ; CHECK-NEXT: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr [[COPY]], [[COPY2]], implicit-def $nzcv
196 ; CHECK-NEXT: [[SBCSXr:%[0-9]+]]:gpr64 = SBCSXr [[COPY1]], [[COPY3]], implicit-def $nzcv, implicit $nzcv
197 ; CHECK-NEXT: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 7, implicit $nzcv
198 ; CHECK-NEXT: $w0 = COPY [[CSINCWr]]
199 ; CHECK-NEXT: RET_ReallyLR implicit $w0
200 %0:gpr(s64) = COPY $x0
201 %1:gpr(s64) = COPY $x1
202 %2:gpr(s64) = COPY $x2
203 %3:gpr(s64) = COPY $x3
204 %4:gpr(s64), %5:gpr(s32) = G_USUBO %0, %2
205 %6:gpr(s64), %7:gpr(s32) = G_SSUBE %1, %3, %5
207 RET_ReallyLR implicit $w0