[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / AArch64 / GlobalISel / legalize-uadd-sat.mir
blob1fa2a3a4a8e397789d804323bde7a800efa9836a
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -march=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
3 ---
4 name:            func
5 alignment:       4
6 tracksRegLiveness: true
7 liveins:
8   - { reg: '$w0' }
9   - { reg: '$w1' }
10 body:             |
11   bb.1:
12     liveins: $w0, $w1
14     ; CHECK-LABEL: name: func
15     ; CHECK: liveins: $w0, $w1
16     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
17     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
18     ; CHECK: [[UADDO:%[0-9]+]]:_(s32), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY1]]
19     ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
20     ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[UADDO1]](s1), [[C]], [[UADDO]]
21     ; CHECK: $w0 = COPY [[SELECT]](s32)
22     ; CHECK: RET_ReallyLR implicit $w0
23     %0:_(s32) = COPY $w0
24     %1:_(s32) = COPY $w1
25     %2:_(s32) = G_UADDSAT %0, %1
26     $w0 = COPY %2(s32)
27     RET_ReallyLR implicit $w0
29 ...
30 ---
31 name:            func2
32 alignment:       4
33 tracksRegLiveness: true
34 liveins:
35   - { reg: '$x0' }
36   - { reg: '$x1' }
37 body:             |
38   bb.1:
39     liveins: $x0, $x1
41     ; CHECK-LABEL: name: func2
42     ; CHECK: liveins: $x0, $x1
43     ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
44     ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
45     ; CHECK: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY1]]
46     ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
47     ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[UADDO1]](s1), [[C]], [[UADDO]]
48     ; CHECK: $x0 = COPY [[SELECT]](s64)
49     ; CHECK: RET_ReallyLR implicit $x0
50     %0:_(s64) = COPY $x0
51     %1:_(s64) = COPY $x1
52     %2:_(s64) = G_UADDSAT %0, %1
53     $x0 = COPY %2(s64)
54     RET_ReallyLR implicit $x0
56 ...
57 ---
58 name:            func16
59 alignment:       4
60 tracksRegLiveness: true
61 liveins:
62   - { reg: '$w0' }
63   - { reg: '$w1' }
64 body:             |
65   bb.1:
66     liveins: $w0, $w1
68     ; CHECK-LABEL: name: func16
69     ; CHECK: liveins: $w0, $w1
70     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
71     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
72     ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
73     ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
74     ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
75     ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
76     ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
77     ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
78     ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
79     ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
80     ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
81     ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
82     ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
83     ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
84     ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[C1]], [[COPY5]]
85     ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
86     ; CHECK: $w0 = COPY [[COPY6]](s32)
87     ; CHECK: RET_ReallyLR implicit $w0
88     %2:_(s32) = COPY $w0
89     %0:_(s16) = G_TRUNC %2(s32)
90     %3:_(s32) = COPY $w1
91     %1:_(s16) = G_TRUNC %3(s32)
92     %4:_(s16) = G_UADDSAT %0, %1
93     %5:_(s32) = G_ANYEXT %4(s16)
94     $w0 = COPY %5(s32)
95     RET_ReallyLR implicit $w0
97 ...
98 ---
99 name:            func8
100 alignment:       4
101 tracksRegLiveness: true
102 liveins:
103   - { reg: '$w0' }
104   - { reg: '$w1' }
105 body:             |
106   bb.1:
107     liveins: $w0, $w1
109     ; CHECK-LABEL: name: func8
110     ; CHECK: liveins: $w0, $w1
111     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
112     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
113     ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
114     ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
115     ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
116     ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
117     ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
118     ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
119     ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
120     ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
121     ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
122     ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
123     ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
124     ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
125     ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[C1]], [[COPY5]]
126     ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
127     ; CHECK: $w0 = COPY [[COPY6]](s32)
128     ; CHECK: RET_ReallyLR implicit $w0
129     %2:_(s32) = COPY $w0
130     %0:_(s8) = G_TRUNC %2(s32)
131     %3:_(s32) = COPY $w1
132     %1:_(s8) = G_TRUNC %3(s32)
133     %4:_(s8) = G_UADDSAT %0, %1
134     %5:_(s32) = G_ANYEXT %4(s8)
135     $w0 = COPY %5(s32)
136     RET_ReallyLR implicit $w0
140 name:            func3
141 alignment:       4
142 tracksRegLiveness: true
143 liveins:
144   - { reg: '$w0' }
145   - { reg: '$w1' }
146 frameInfo:
147   maxAlignment:    1
148 machineFunctionInfo: {}
149 body:             |
150   bb.1:
151     liveins: $w0, $w1
153     ; CHECK-LABEL: name: func3
154     ; CHECK: liveins: $w0, $w1
155     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
156     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
157     ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
158     ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
159     ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
160     ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
161     ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
162     ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND]], [[AND1]]
163     ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
164     ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C]]
165     ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[ADD]](s32), [[AND2]]
166     ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s32)
167     ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[C]](s32)
168     ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ADD]](s32)
169     ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[COPY5]], [[COPY6]]
170     ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
171     ; CHECK: $w0 = COPY [[COPY7]](s32)
172     ; CHECK: RET_ReallyLR implicit $w0
173     %2:_(s32) = COPY $w0
174     %0:_(s4) = G_TRUNC %2(s32)
175     %3:_(s32) = COPY $w1
176     %1:_(s4) = G_TRUNC %3(s32)
177     %4:_(s4) = G_UADDSAT %0, %1
178     %5:_(s32) = G_ANYEXT %4(s4)
179     $w0 = COPY %5(s32)
180     RET_ReallyLR implicit $w0