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: sadde_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]+]]:gpr32common = MOVi32imm 1
20 ; CHECK-NEXT: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[MOVi32imm]], 1, 0, implicit-def $nzcv
21 ; CHECK-NEXT: [[ADCSXr:%[0-9]+]]:gpr64 = ADCSXr [[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 [[ADCSXr]]
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_SADDE %0, %1, %2
32 RET_ReallyLR implicit $x0, implicit $w1
40 tracksRegLiveness: true
45 ; CHECK-LABEL: name: sadde_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]+]]:gpr32common = MOVi32imm 1
51 ; CHECK-NEXT: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[MOVi32imm]], 1, 0, implicit-def $nzcv
52 ; CHECK-NEXT: [[ADCSWr:%[0-9]+]]:gpr32 = ADCSWr [[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 [[ADCSWr]]
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_SADDE %0, %1, %2
63 RET_ReallyLR implicit $w0, implicit $w1
67 name: sadde_opt_prev_uaddo
71 tracksRegLiveness: true
74 liveins: $x0, $x1, $x2, $x3
76 ; CHECK-LABEL: name: sadde_opt_prev_uaddo
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: [[ADDSXrr:%[0-9]+]]:gpr64 = ADDSXrr [[COPY]], [[COPY2]], implicit-def $nzcv
84 ; CHECK-NEXT: [[ADCSXr:%[0-9]+]]:gpr64 = ADCSXr [[COPY1]], [[COPY3]], implicit-def $nzcv, implicit $nzcv
85 ; CHECK-NEXT: $x0 = COPY [[ADDSXrr]]
86 ; CHECK-NEXT: $x1 = COPY [[ADCSXr]]
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_UADDO %0, %2
93 %9:gpr(s64), %13:gpr(s32) = G_SADDE %1, %3, %12
96 RET_ReallyLR implicit $x0, implicit $x1
100 name: sadde_opt_prev_uadde
103 regBankSelected: true
104 tracksRegLiveness: true
107 liveins: $x0, $x1, $x2, $x3
109 ; CHECK-LABEL: name: sadde_opt_prev_uadde
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]+]]:gpr32common = MOVi32imm 1
117 ; CHECK-NEXT: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[MOVi32imm]], 1, 0, implicit-def $nzcv
118 ; CHECK-NEXT: [[ADCSXr:%[0-9]+]]:gpr64 = ADCSXr [[COPY]], [[COPY2]], implicit-def $nzcv, implicit $nzcv
119 ; CHECK-NEXT: [[ADCSXr1:%[0-9]+]]:gpr64 = ADCSXr [[COPY1]], [[COPY3]], implicit-def $nzcv, implicit $nzcv
120 ; CHECK-NEXT: $x0 = COPY [[ADCSXr]]
121 ; CHECK-NEXT: $x1 = COPY [[ADCSXr1]]
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_UADDE %0, %2, %6
129 %9:gpr(s64), %13:gpr(s32) = G_SADDE %1, %3, %12
132 RET_ReallyLR implicit $x0, implicit $x1
136 name: sadde_opt_bail_clobber
139 regBankSelected: true
140 tracksRegLiveness: true
143 liveins: $x0, $x1, $x2, $x4, $x5, $x6
145 ; CHECK-LABEL: name: sadde_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: [[ADDSXrr:%[0-9]+]]:gpr64 = ADDSXrr [[COPY]], [[COPY3]], implicit-def $nzcv
155 ; CHECK-NEXT: [[CSINCWr:%[0-9]+]]:gpr32common = CSINCWr $wzr, $wzr, 3, implicit $nzcv
156 ; CHECK-NEXT: [[ADCSXr:%[0-9]+]]:gpr64 = ADCSXr [[COPY1]], [[COPY4]], implicit-def $nzcv, implicit $nzcv
157 ; CHECK-NEXT: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[CSINCWr]], 1, 0, implicit-def $nzcv
158 ; CHECK-NEXT: [[ADCSXr1:%[0-9]+]]:gpr64 = ADCSXr [[COPY2]], [[COPY5]], implicit-def $nzcv, implicit $nzcv
159 ; CHECK-NEXT: $x0 = COPY [[ADDSXrr]]
160 ; CHECK-NEXT: $x1 = COPY [[ADCSXr]]
161 ; CHECK-NEXT: $x2 = COPY [[ADCSXr1]]
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_UADDO %0, %4
170 %8:gpr(s64), %12:gpr(s32) = G_UADDE %1, %5, %11
171 ; carry-in is not produced by previous instruction
172 %9:gpr(s64), %13:gpr(s32) = G_SADDE %2, %6, %11
176 RET_ReallyLR implicit $x0, implicit $x1, implicit $x2