Commit 1762f16
authored
[InstCombine] Fold
- Closes llvm#129947
This PR introduces the following transformations:
1. `umax(nuw_shl(z, x), nuw_shl(z, y)) -> nuw_shl(z, umax(x, y))`
2. `umin(nuw_shl(z, x), nuw_shl(z, y)) -> nuw_shl(z, umin(x, y))`
3. `umax(nuw_shl(x, z), nuw_shl(y, z)) -> nuw_shl(umax(x, y),z)`
4. `umin(nuw_shl(x, z), nuw_shl(y, z)) -> nuw_shl(umin(x, y),z)`
Alive2 live proof:
- https://alive2.llvm.org/ce/z/6bM-p7 for 1 and 2
- https://alive2.llvm.org/ce/z/aqLRYA and
https://alive2.llvm.org/ce/z/twoVhb for 3 and 4 repectivelyumax/umin(nuw_shl(z, x), nuw_shl(z, y)) -> nuw_shl(z, umax/umin(x, y)) and umax/umin(nuw_shl(x, z), nuw_shl(y, z)) -> nuw_shl(umax/umin(x, y), z) (llvm#131076)1 parent 215c47e commit 1762f16
File tree
4 files changed
+716
-77
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
4 files changed
+716
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1554 | 1554 | | |
1555 | 1555 | | |
1556 | 1556 | | |
1557 | | - | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
1558 | 1562 | | |
1559 | 1563 | | |
1560 | 1564 | | |
| |||
1592 | 1596 | | |
1593 | 1597 | | |
1594 | 1598 | | |
1595 | | - | |
1596 | | - | |
1597 | | - | |
1598 | 1599 | | |
1599 | 1600 | | |
1600 | 1601 | | |
1601 | 1602 | | |
1602 | 1603 | | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
1607 | | - | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1608 | 1608 | | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1609 | 1615 | | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | | - | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1615 | 1624 | | |
1616 | 1625 | | |
1617 | | - | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
1618 | 1630 | | |
1619 | 1631 | | |
1620 | 1632 | | |
| |||
1887 | 1899 | | |
1888 | 1900 | | |
1889 | 1901 | | |
| 1902 | + | |
1890 | 1903 | | |
1891 | 1904 | | |
1892 | 1905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 147 | + | |
| 148 | + | |
150 | 149 | | |
151 | | - | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
| |||
0 commit comments