Debian Codegraph @

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-xor-rv32.mir

raw
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
3 # RUN: | FileCheck %s
4 ---
5 name: xor_i7
6 body: |
7 bb.0.entry:
8 ; CHECK-LABEL: name: xor_i7
9 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
10 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
11 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]]
12 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
13 ; CHECK-NEXT: PseudoRET implicit $x10
14 %0:_(s32) = COPY $x10
15 %1:_(s32) = COPY $x11
16 %2:_(s7) = G_TRUNC %0(s32)
17 %3:_(s7) = G_TRUNC %1(s32)
18 %4:_(s7) = G_XOR %2, %3
19 %5:_(s32) = G_ANYEXT %4(s7)
20 $x10 = COPY %5(s32)
21 PseudoRET implicit $x10
22
23 ...
24 ---
25 name: xor_i8
26 body: |
27 bb.0.entry:
28 ; CHECK-LABEL: name: xor_i8
29 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
30 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
31 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]]
32 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
33 ; CHECK-NEXT: PseudoRET implicit $x10
34 %0:_(s32) = COPY $x10
35 %1:_(s32) = COPY $x11
36 %2:_(s8) = G_TRUNC %0(s32)
37 %3:_(s8) = G_TRUNC %1(s32)
38 %4:_(s8) = G_XOR %2, %3
39 %5:_(s32) = G_ANYEXT %4(s8)
40 $x10 = COPY %5(s32)
41 PseudoRET implicit $x10
42
43 ...
44 ---
45 name: xor_i16
46 body: |
47 bb.0.entry:
48 ; CHECK-LABEL: name: xor_i16
49 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
51 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]]
52 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
53 ; CHECK-NEXT: PseudoRET implicit $x10
54 %0:_(s32) = COPY $x10
55 %1:_(s32) = COPY $x11
56 %2:_(s16) = G_TRUNC %0(s32)
57 %3:_(s16) = G_TRUNC %1(s32)
58 %4:_(s16) = G_XOR %2, %3
59 %5:_(s32) = G_ANYEXT %4(s16)
60 $x10 = COPY %5(s32)
61 PseudoRET implicit $x10
62
63 ...
64 ---
65 name: xor_i32
66 body: |
67 bb.0.entry:
68 ; CHECK-LABEL: name: xor_i32
69 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
70 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
71 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]]
72 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
73 ; CHECK-NEXT: PseudoRET implicit $x10
74 %0:_(s32) = COPY $x10
75 %1:_(s32) = COPY $x11
76 %2:_(s32) = G_XOR %0, %1
77 $x10 = COPY %2(s32)
78 PseudoRET implicit $x10
79
80 ...
81 ---
82 name: xor_i48
83 body: |
84 bb.0.entry:
85 ; CHECK-LABEL: name: xor_i48
86 ; CHECK: %xlo:_(s32) = COPY $x10
87 ; CHECK-NEXT: %xhi:_(s32) = COPY $x11
88 ; CHECK-NEXT: %ylo:_(s32) = COPY $x12
89 ; CHECK-NEXT: %yhi:_(s32) = COPY $x13
90 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %xlo, %ylo
91 ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR %xhi, %yhi
92 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
93 ; CHECK-NEXT: $x11 = COPY [[XOR1]](s32)
94 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
95 %xlo:_(s32) = COPY $x10
96 %xhi:_(s32) = COPY $x11
97 %ylo:_(s32) = COPY $x12
98 %yhi:_(s32) = COPY $x13
99 %x0:_(s64) = G_MERGE_VALUES %xlo(s32), %xhi(s32)
100 %y0:_(s64) = G_MERGE_VALUES %ylo(s32), %yhi(s32)
101 %x:_(s48) = G_TRUNC %x0(s64)
102 %y:_(s48) = G_TRUNC %y0(s64)
103 %z:_(s48) = G_XOR %x, %y
104 %z0:_(s64) = G_ANYEXT %z(s48)
105 %zlo:_(s32), %zhi:_(s32) = G_UNMERGE_VALUES %z0(s64)
106 $x10 = COPY %zlo(s32)
107 $x11 = COPY %zhi(s32)
108 PseudoRET implicit $x10, implicit $x11
109
110 ...
111 ---
112 name: xor_i64
113 body: |
114 bb.0.entry:
115 ; CHECK-LABEL: name: xor_i64
116 ; CHECK: %lo1:_(s32) = COPY $x10
117 ; CHECK-NEXT: %hi1:_(s32) = COPY $x11
118 ; CHECK-NEXT: %lo2:_(s32) = COPY $x12
119 ; CHECK-NEXT: %hi2:_(s32) = COPY $x13
120 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %lo1, %lo2
121 ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR %hi1, %hi2
122 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
123 ; CHECK-NEXT: $x11 = COPY [[XOR1]](s32)
124 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
125 %lo1:_(s32) = COPY $x10
126 %hi1:_(s32) = COPY $x11
127 %lo2:_(s32) = COPY $x12
128 %hi2:_(s32) = COPY $x13
129 %x1:_(s64) = G_MERGE_VALUES %lo1(s32), %hi1(s32)
130 %x2:_(s64) = G_MERGE_VALUES %lo2(s32), %hi2(s32)
131 %y:_(s64) = G_XOR %x1, %x2
132 %loy:_(s32), %hiy:_(s32) = G_UNMERGE_VALUES %y(s64)
133 $x10 = COPY %loy(s32)
134 $x11 = COPY %hiy(s32)
135 PseudoRET implicit $x10, implicit $x11
136
137 ...
138 ---
139 name: xor_i96
140 body: |
141 bb.0.entry:
142 ; CHECK-LABEL: name: xor_i96
143 ; CHECK: %lo1:_(s32) = COPY $x10
144 ; CHECK-NEXT: %mid1:_(s32) = COPY $x11
145 ; CHECK-NEXT: %hi1:_(s32) = COPY $x12
146 ; CHECK-NEXT: %lo2:_(s32) = COPY $x13
147 ; CHECK-NEXT: %mid2:_(s32) = COPY $x14
148 ; CHECK-NEXT: %hi2:_(s32) = COPY $x15
149 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR %lo1, %lo2
150 ; CHECK-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR %mid1, %mid2
151 ; CHECK-NEXT: [[XOR2:%[0-9]+]]:_(s32) = G_XOR %hi1, %hi2
152 ; CHECK-NEXT: $x10 = COPY [[XOR]](s32)
153 ; CHECK-NEXT: $x11 = COPY [[XOR1]](s32)
154 ; CHECK-NEXT: $x12 = COPY [[XOR2]](s32)
155 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
156 %lo1:_(s32) = COPY $x10
157 %mid1:_(s32) = COPY $x11
158 %hi1:_(s32) = COPY $x12
159 %lo2:_(s32) = COPY $x13
160 %mid2:_(s32) = COPY $x14
161 %hi2:_(s32) = COPY $x15
162 %x1:_(s96) = G_MERGE_VALUES %lo1(s32), %mid1(s32), %hi1(s32)
163 %x2:_(s96) = G_MERGE_VALUES %lo2(s32), %mid2(s32), %hi2(s32)
164 %y:_(s96) = G_XOR %x1, %x2
165 %lo:_(s32), %mid:_(s32), %hi:_(s32) = G_UNMERGE_VALUES %y(s96)
166 $x10 = COPY %lo(s32)
167 $x11 = COPY %mid(s32)
168 $x12 = COPY %hi(s32)
169 PseudoRET implicit $x10, implicit $x11, implicit $x12
170
171 ...