Commit 4ce74bf
authored
[RISCV] Use default promotion for i32 CTLZ on RV64 with XTHeadBb. (llvm#157994)
The existing isel pattern felt like it was emitting more instructions
than an isel pattern probably should. We were also missing opportunities
to fold the innermost instructions with surrounding instructions.
I tried to move the expansion to lowering, but we got a little too
aggressive folding the (not (slli (not))) with other operations in some
tests and created code with constants that are hard to materialize and
missed using TH_FF0. We could probably have fixed that with a
RISCVISD::TH_FF0 node.
While investigating, I tried using the default promotion. The results
aren't obviously worse than the previous codegen. And in some case they
are obviously better.1 parent 3e18b5a commit 4ce74bf
File tree
4 files changed
+17
-25
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV
4 files changed
+17
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
431 | 428 | | |
432 | 429 | | |
433 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
597 | | - | |
598 | | - | |
599 | 597 | | |
600 | 598 | | |
601 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1375 | 1375 | | |
1376 | 1376 | | |
1377 | 1377 | | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
1381 | 1381 | | |
1382 | 1382 | | |
1383 | 1383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
| |||
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
| |||
309 | 307 | | |
310 | 308 | | |
311 | 309 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 310 | + | |
| 311 | + | |
315 | 312 | | |
316 | 313 | | |
317 | 314 | | |
| |||
0 commit comments