Commit 58cc167
authored
[SDAG] Fix fmaximum legalization errors (llvm#142170)
FMAXIMUM is currently legalized via IS_FPCLASS for the signed zero
handling. This is problematic, because it assumes the equivalent integer
type is legal. Many targets have legal fp128, but illegal i128, so this
results in legalization failures.
Fix this by replacing IS_FPCLASS with checking the bitcast to integer
instead. In that case it is sufficient to use any legal integer type, as
we're just interested in the sign bit. This can be obtained via a stack
temporary cast. There is existing FloatSignAsInt functionality used for
legalization of FABS and similar we can use for this purpose.
Fixes llvm#139380.
Fixes llvm#139381.
Fixes llvm#140445.1 parent f3f07a3 commit 58cc167
File tree
12 files changed
+1183
-385
lines changed- llvm
- include/llvm/CodeGen
- lib/CodeGen/SelectionDAG
- test/CodeGen
- AArch64
- ARM
- NVPTX
- PowerPC
- X86
12 files changed
+1183
-385
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
218 | 232 | | |
219 | 233 | | |
220 | 234 | | |
| |||
2017 | 2031 | | |
2018 | 2032 | | |
2019 | 2033 | | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
2020 | 2044 | | |
2021 | 2045 | | |
2022 | 2046 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 62 | | |
77 | 63 | | |
78 | 64 | | |
| |||
166 | 152 | | |
167 | 153 | | |
168 | 154 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | 155 | | |
174 | 156 | | |
175 | 157 | | |
| |||
1620 | 1602 | | |
1621 | 1603 | | |
1622 | 1604 | | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | 1605 | | |
1692 | 1606 | | |
1693 | 1607 | | |
1694 | 1608 | | |
1695 | 1609 | | |
1696 | 1610 | | |
1697 | 1611 | | |
1698 | | - | |
| 1612 | + | |
1699 | 1613 | | |
1700 | 1614 | | |
1701 | 1615 | | |
| |||
1716 | 1630 | | |
1717 | 1631 | | |
1718 | 1632 | | |
1719 | | - | |
| 1633 | + | |
1720 | 1634 | | |
1721 | 1635 | | |
1722 | 1636 | | |
| |||
1746 | 1660 | | |
1747 | 1661 | | |
1748 | 1662 | | |
1749 | | - | |
| 1663 | + | |
1750 | 1664 | | |
1751 | 1665 | | |
1752 | 1666 | | |
1753 | 1667 | | |
1754 | 1668 | | |
1755 | 1669 | | |
1756 | | - | |
| 1670 | + | |
1757 | 1671 | | |
1758 | 1672 | | |
1759 | 1673 | | |
| |||
1762 | 1676 | | |
1763 | 1677 | | |
1764 | 1678 | | |
1765 | | - | |
| 1679 | + | |
1766 | 1680 | | |
1767 | 1681 | | |
1768 | 1682 | | |
| |||
1778 | 1692 | | |
1779 | 1693 | | |
1780 | 1694 | | |
1781 | | - | |
| 1695 | + | |
1782 | 1696 | | |
1783 | 1697 | | |
1784 | 1698 | | |
1785 | 1699 | | |
1786 | | - | |
| 1700 | + | |
1787 | 1701 | | |
1788 | 1702 | | |
1789 | 1703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2760 | 2760 | | |
2761 | 2761 | | |
2762 | 2762 | | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
2763 | 2823 | | |
2764 | 2824 | | |
2765 | 2825 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8610 | 8610 | | |
8611 | 8611 | | |
8612 | 8612 | | |
| 8613 | + | |
| 8614 | + | |
| 8615 | + | |
| 8616 | + | |
| 8617 | + | |
| 8618 | + | |
| 8619 | + | |
8613 | 8620 | | |
8614 | 8621 | | |
8615 | | - | |
8616 | | - | |
8617 | | - | |
8618 | | - | |
8619 | | - | |
8620 | | - | |
8621 | | - | |
8622 | | - | |
| 8622 | + | |
| 8623 | + | |
| 8624 | + | |
8623 | 8625 | | |
8624 | 8626 | | |
8625 | 8627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
0 commit comments