Skip to content

Commit 74fbdbf

Browse files
authored
[RISCV][GISel][NFC] Add MIR legalizer tests for G_UADDE (rv32 & rv64) (#152827)
Add MIR tests that exercise legalization of the G_UADDE (unsigned add with extend/carry) operation for RISC-V targets.
1 parent 544562e commit 74fbdbf

File tree

2 files changed

+387
-0
lines changed

2 files changed

+387
-0
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2+
# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - | FileCheck %s
3+
4+
---
5+
name: uadde_i8
6+
body: |
7+
bb.1:
8+
liveins: $x10, $x11, $x12
9+
10+
; CHECK-LABEL: name: uadde_i8
11+
; CHECK: liveins: $x10, $x11, $x12
12+
; CHECK-NEXT: {{ $}}
13+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
14+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
15+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
16+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
17+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
18+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
19+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
20+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
21+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
22+
; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
23+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[AND2]]
24+
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
25+
; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ADD1]], [[C]]
26+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[AND3]](s32), [[C2]]
27+
; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[COPY2]]
28+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[AND4]]
29+
; CHECK-NEXT: $x10 = COPY [[ADD1]](s32)
30+
; CHECK-NEXT: $x11 = COPY [[OR]](s32)
31+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
32+
%0:_(s32) = COPY $x10
33+
%1:_(s8) = G_TRUNC %0(s32)
34+
%2:_(s32) = COPY $x11
35+
%3:_(s8) = G_TRUNC %2(s32)
36+
%4:_(s32) = COPY $x12
37+
%5:_(s1) = G_TRUNC %4(s32)
38+
%6:_(s8), %7:_(s1) = G_UADDE %1, %3, %5
39+
%8:_(s32) = G_ANYEXT %6(s8)
40+
%9:_(s32) = G_ANYEXT %7(s1)
41+
$x10 = COPY %8(s32)
42+
$x11 = COPY %9(s32)
43+
PseudoRET implicit $x10, implicit $x11
44+
45+
...
46+
---
47+
name: uadde_i16
48+
body: |
49+
bb.1:
50+
liveins: $x10, $x11, $x12
51+
52+
; CHECK-LABEL: name: uadde_i16
53+
; CHECK: liveins: $x10, $x11, $x12
54+
; CHECK-NEXT: {{ $}}
55+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
56+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
57+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
58+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
59+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
60+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
61+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
62+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
63+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
64+
; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
65+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[AND2]]
66+
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
67+
; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ADD1]], [[C]]
68+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[AND3]](s32), [[C2]]
69+
; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[COPY2]]
70+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[AND4]]
71+
; CHECK-NEXT: $x10 = COPY [[ADD1]](s32)
72+
; CHECK-NEXT: $x11 = COPY [[OR]](s32)
73+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
74+
%0:_(s32) = COPY $x10
75+
%1:_(s16) = G_TRUNC %0(s32)
76+
%2:_(s32) = COPY $x11
77+
%3:_(s16) = G_TRUNC %2(s32)
78+
%4:_(s32) = COPY $x12
79+
%5:_(s1) = G_TRUNC %4(s32)
80+
%6:_(s16), %7:_(s1) = G_UADDE %1, %3, %5
81+
%8:_(s32) = G_ANYEXT %6(s16)
82+
%9:_(s32) = G_ANYEXT %7(s1)
83+
$x10 = COPY %8(s32)
84+
$x11 = COPY %9(s32)
85+
PseudoRET implicit $x10, implicit $x11
86+
87+
...
88+
---
89+
name: uadde_i32
90+
body: |
91+
bb.1:
92+
liveins: $x10, $x11, $x12
93+
94+
; CHECK-LABEL: name: uadde_i32
95+
; CHECK: liveins: $x10, $x11, $x12
96+
; CHECK-NEXT: {{ $}}
97+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
98+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
99+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
100+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]]
101+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY]]
102+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
103+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
104+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[AND]]
105+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
106+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[ADD1]](s32), [[C1]]
107+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[COPY2]]
108+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[AND1]]
109+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ADD1]](s32)
110+
; CHECK-NEXT: $x10 = COPY [[COPY3]](s32)
111+
; CHECK-NEXT: $x11 = COPY [[OR]](s32)
112+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
113+
%0:_(s32) = COPY $x10
114+
%1:_(s32) = COPY $x11
115+
%2:_(s32) = COPY $x12
116+
%3:_(s1) = G_TRUNC %2(s32)
117+
%4:_(s32), %5:_(s1) = G_UADDE %0, %1, %3
118+
%6:_(s32) = G_ANYEXT %5(s1)
119+
$x10 = COPY %4(s32)
120+
$x11 = COPY %6(s32)
121+
PseudoRET implicit $x10, implicit $x11
122+
123+
...
124+
---
125+
name: uadde_i64
126+
body: |
127+
bb.1:
128+
liveins: $x10, $x11, $x12, $x13, $x14
129+
130+
; CHECK-LABEL: name: uadde_i64
131+
; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
132+
; CHECK-NEXT: {{ $}}
133+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
134+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
135+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
136+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
137+
; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x14
138+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY2]]
139+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY]]
140+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
141+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
142+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[ADD]], [[AND]]
143+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
144+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[ADD1]](s32), [[C1]]
145+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[COPY4]]
146+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[AND1]]
147+
; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD1]](s32)
148+
; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY3]]
149+
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD2]](s32), [[COPY1]]
150+
; CHECK-NEXT: [[ADD3:%[0-9]+]]:_(s32) = G_ADD [[ADD2]], [[OR]]
151+
; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[ADD3]](s32), [[C1]]
152+
; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ICMP3]], [[OR]]
153+
; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[ICMP2]], [[AND2]]
154+
; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ADD3]](s32)
155+
; CHECK-NEXT: $x10 = COPY [[COPY5]](s32)
156+
; CHECK-NEXT: $x11 = COPY [[COPY6]](s32)
157+
; CHECK-NEXT: $x12 = COPY [[OR1]](s32)
158+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
159+
%0:_(s32) = COPY $x10
160+
%1:_(s32) = COPY $x11
161+
%2:_(s32) = COPY $x12
162+
%3:_(s32) = COPY $x13
163+
%4:_(s32) = COPY $x14
164+
%5:_(s1) = G_TRUNC %4(s32)
165+
%6:_(s32), %7:_(s1) = G_UADDE %0, %2, %5
166+
%8:_(s32), %9:_(s1) = G_UADDE %1, %3, %7
167+
%10:_(s32) = G_ANYEXT %9(s1)
168+
$x10 = COPY %6(s32)
169+
$x11 = COPY %8(s32)
170+
$x12 = COPY %10(s32)
171+
172+
PseudoRET implicit $x10, implicit $x11, implicit $x12
173+
...
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2+
# RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - | FileCheck %s
3+
4+
---
5+
name: uadde_i8
6+
body: |
7+
bb.1:
8+
liveins: $x10, $x11, $x12
9+
10+
; CHECK-LABEL: name: uadde_i8
11+
; CHECK: liveins: $x10, $x11, $x12
12+
; CHECK-NEXT: {{ $}}
13+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
14+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
15+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x12
16+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[COPY1]]
17+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
18+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ADD]], [[C]]
19+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
20+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[AND]](s64), [[AND1]]
21+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
22+
; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C1]]
23+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s64) = G_ADD [[ADD]], [[AND2]]
24+
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
25+
; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[ADD1]], [[C]]
26+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[AND3]](s64), [[C2]]
27+
; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s64) = G_AND [[ICMP1]], [[COPY2]]
28+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ICMP]], [[AND4]]
29+
; CHECK-NEXT: $x10 = COPY [[ADD1]](s64)
30+
; CHECK-NEXT: $x11 = COPY [[OR]](s64)
31+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
32+
%0:_(s64) = COPY $x10
33+
%1:_(s8) = G_TRUNC %0(s64)
34+
%2:_(s64) = COPY $x11
35+
%3:_(s8) = G_TRUNC %2(s64)
36+
%4:_(s64) = COPY $x12
37+
%5:_(s1) = G_TRUNC %4(s64)
38+
%6:_(s8), %7:_(s1) = G_UADDE %1, %3, %5
39+
%8:_(s64) = G_ANYEXT %6(s8)
40+
%9:_(s64) = G_ANYEXT %7(s1)
41+
$x10 = COPY %8(s64)
42+
$x11 = COPY %9(s64)
43+
PseudoRET implicit $x10, implicit $x11
44+
45+
...
46+
---
47+
name: uadde_i16
48+
body: |
49+
bb.1:
50+
liveins: $x10, $x11, $x12
51+
52+
; CHECK-LABEL: name: uadde_i16
53+
; CHECK: liveins: $x10, $x11, $x12
54+
; CHECK-NEXT: {{ $}}
55+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
56+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
57+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x12
58+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[COPY1]]
59+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
60+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ADD]], [[C]]
61+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
62+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[AND]](s64), [[AND1]]
63+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
64+
; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C1]]
65+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s64) = G_ADD [[ADD]], [[AND2]]
66+
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
67+
; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s64) = G_AND [[ADD1]], [[C]]
68+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[AND3]](s64), [[C2]]
69+
; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s64) = G_AND [[ICMP1]], [[COPY2]]
70+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ICMP]], [[AND4]]
71+
; CHECK-NEXT: $x10 = COPY [[ADD1]](s64)
72+
; CHECK-NEXT: $x11 = COPY [[OR]](s64)
73+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
74+
%0:_(s64) = COPY $x10
75+
%1:_(s16) = G_TRUNC %0(s64)
76+
%2:_(s64) = COPY $x11
77+
%3:_(s16) = G_TRUNC %2(s64)
78+
%4:_(s64) = COPY $x12
79+
%5:_(s1) = G_TRUNC %4(s64)
80+
%6:_(s16), %7:_(s1) = G_UADDE %1, %3, %5
81+
%8:_(s64) = G_ANYEXT %6(s16)
82+
%9:_(s64) = G_ANYEXT %7(s1)
83+
$x10 = COPY %8(s64)
84+
$x11 = COPY %9(s64)
85+
PseudoRET implicit $x10, implicit $x11
86+
87+
...
88+
---
89+
name: uadde_i32
90+
body: |
91+
bb.1:
92+
liveins: $x10, $x11, $x12
93+
94+
; CHECK-LABEL: name: uadde_i32
95+
; CHECK: liveins: $x10, $x11, $x12
96+
; CHECK-NEXT: {{ $}}
97+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
98+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
99+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x12
100+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[COPY1]]
101+
; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[ADD]], 32
102+
; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
103+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[SEXT_INREG]](s64), [[SEXT_INREG1]]
104+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
105+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
106+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s64) = G_ADD [[SEXT_INREG]], [[AND]]
107+
; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[ADD1]], 32
108+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
109+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[SEXT_INREG2]](s64), [[C1]]
110+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[ICMP1]], [[COPY2]]
111+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ICMP]], [[AND1]]
112+
; CHECK-NEXT: $x10 = COPY [[SEXT_INREG2]](s64)
113+
; CHECK-NEXT: $x11 = COPY [[OR]](s64)
114+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
115+
%0:_(s64) = COPY $x10
116+
%1:_(s32) = G_TRUNC %0(s64)
117+
%2:_(s64) = COPY $x11
118+
%3:_(s32) = G_TRUNC %2(s64)
119+
%4:_(s64) = COPY $x12
120+
%5:_(s1) = G_TRUNC %4(s64)
121+
%6:_(s32), %7:_(s1) = G_UADDE %1, %3, %5
122+
%8:_(s64) = G_ANYEXT %6(s32)
123+
%9:_(s64) = G_ANYEXT %7(s1)
124+
$x10 = COPY %8(s64)
125+
$x11 = COPY %9(s64)
126+
PseudoRET implicit $x10, implicit $x11
127+
128+
...
129+
---
130+
name: uadde_i64
131+
body: |
132+
bb.1:
133+
liveins: $x10, $x11, $x12
134+
135+
; CHECK-LABEL: name: uadde_i64
136+
; CHECK: liveins: $x10, $x11, $x12
137+
; CHECK-NEXT: {{ $}}
138+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
139+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
140+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x12
141+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[COPY1]]
142+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[ADD]](s64), [[COPY]]
143+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
144+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
145+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s64) = G_ADD [[ADD]], [[AND]]
146+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
147+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[ADD1]](s64), [[C1]]
148+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[ICMP1]], [[COPY2]]
149+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ICMP]], [[AND1]]
150+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY [[ADD1]](s64)
151+
; CHECK-NEXT: $x10 = COPY [[COPY3]](s64)
152+
; CHECK-NEXT: $x11 = COPY [[OR]](s64)
153+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
154+
%0:_(s64) = COPY $x10
155+
%1:_(s64) = COPY $x11
156+
%2:_(s64) = COPY $x12
157+
%3:_(s1) = G_TRUNC %2(s64)
158+
%4:_(s64), %5:_(s1) = G_UADDE %0, %1, %3
159+
%6:_(s64) = G_ANYEXT %5(s1)
160+
$x10 = COPY %4(s64)
161+
$x11 = COPY %6(s64)
162+
PseudoRET implicit $x10, implicit $x11
163+
164+
...
165+
---
166+
name: uadde_i128
167+
body: |
168+
bb.1:
169+
liveins: $x10, $x11, $x12, $x13, $x14
170+
171+
; CHECK-LABEL: name: uadde_i128
172+
; CHECK: liveins: $x10, $x11, $x12, $x13, $x14
173+
; CHECK-NEXT: {{ $}}
174+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
175+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
176+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x12
177+
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x13
178+
; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x14
179+
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[COPY2]]
180+
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[ADD]](s64), [[COPY]]
181+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
182+
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY4]], [[C]]
183+
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s64) = G_ADD [[ADD]], [[AND]]
184+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
185+
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[ADD1]](s64), [[C1]]
186+
; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[ICMP1]], [[COPY4]]
187+
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ICMP]], [[AND1]]
188+
; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY [[ADD1]](s64)
189+
; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s64) = G_ADD [[COPY1]], [[COPY3]]
190+
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[ADD2]](s64), [[COPY1]]
191+
; CHECK-NEXT: [[ADD3:%[0-9]+]]:_(s64) = G_ADD [[ADD2]], [[OR]]
192+
; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s64) = G_ICMP intpred(eq), [[ADD3]](s64), [[C1]]
193+
; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s64) = G_AND [[ICMP3]], [[OR]]
194+
; CHECK-NEXT: [[OR1:%[0-9]+]]:_(s64) = G_OR [[ICMP2]], [[AND2]]
195+
; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY [[ADD3]](s64)
196+
; CHECK-NEXT: $x10 = COPY [[COPY5]](s64)
197+
; CHECK-NEXT: $x11 = COPY [[COPY6]](s64)
198+
; CHECK-NEXT: $x12 = COPY [[OR1]](s64)
199+
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
200+
%0:_(s64) = COPY $x10
201+
%1:_(s64) = COPY $x11
202+
%2:_(s64) = COPY $x12
203+
%3:_(s64) = COPY $x13
204+
%4:_(s64) = COPY $x14
205+
%5:_(s1) = G_TRUNC %4(s64)
206+
%6:_(s64), %7:_(s1) = G_UADDE %0, %2, %5
207+
%8:_(s64), %9:_(s1) = G_UADDE %1, %3, %7
208+
%10:_(s64) = G_ANYEXT %9(s1)
209+
$x10 = COPY %6(s64)
210+
$x11 = COPY %8(s64)
211+
$x12 = COPY %10(s64)
212+
213+
PseudoRET implicit $x10, implicit $x11, implicit $x12
214+
...

0 commit comments

Comments
 (0)