Commit 79573fa
committed
[RISCV] Support umin/umax in tryFoldSelectIntoOp
The neutral values for these are -1U, and 0 respectively. We already
have good arithmetic lowerings for selects with one arm equal to these
values. smin/smax are a bit harder, and will be a separate change.
Somewhat surprisingly, this looks to be a net code improvement in all
of the configurations. With both zbb, it's a clear win. With only
zicond, we still seem to come out ahead because we reduce the
number of ziconds needed (since we lower min/max to them). Without
either zbb or zicond, we're a bit more of wash, but the available
arithmetic sequences are good enough that doing the select
unconditionally before using branches for the min/max is probably
still worthwhile?1 parent 2fcbd33 commit 79573fa
File tree
2 files changed
+282
-440
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV
2 files changed
+282
-440
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18835 | 18835 | | |
18836 | 18836 | | |
18837 | 18837 | | |
| 18838 | + | |
| 18839 | + | |
18838 | 18840 | | |
18839 | 18841 | | |
18840 | 18842 | | |
| |||
0 commit comments