Commit aa847ce
authored
[InstCombine] handle trunc to i1 in foldSelectICmpAndBinOp (llvm#127390)
for `trunc nuw` saves a instruction and otherwise only other
instructions without the select, same behavior as for bit test before.
proof: https://alive2.llvm.org/ce/z/a6QmyV1 parent 8ecd788 commit aa847ce
File tree
2 files changed
+49
-42
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
2 files changed
+49
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | | - | |
750 | | - | |
751 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | 758 | | |
762 | 759 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 760 | + | |
| 761 | + | |
767 | 762 | | |
768 | | - | |
769 | | - | |
770 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
771 | 767 | | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
777 | 771 | | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
782 | 790 | | |
783 | 791 | | |
784 | 792 | | |
| |||
812 | 820 | | |
813 | 821 | | |
814 | 822 | | |
815 | | - | |
| 823 | + | |
816 | 824 | | |
817 | 825 | | |
818 | 826 | | |
| |||
1990 | 1998 | | |
1991 | 1999 | | |
1992 | 2000 | | |
1993 | | - | |
1994 | | - | |
1995 | | - | |
1996 | 2001 | | |
1997 | 2002 | | |
1998 | 2003 | | |
| |||
3950 | 3955 | | |
3951 | 3956 | | |
3952 | 3957 | | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
3953 | 3961 | | |
3954 | 3962 | | |
3955 | 3963 | | |
| |||
Lines changed: 14 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1754 | 1754 | | |
1755 | 1755 | | |
1756 | 1756 | | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
| |||
1767 | 1767 | | |
1768 | 1768 | | |
1769 | 1769 | | |
1770 | | - | |
1771 | | - | |
1772 | | - | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
1773 | 1773 | | |
1774 | 1774 | | |
1775 | 1775 | | |
| |||
1781 | 1781 | | |
1782 | 1782 | | |
1783 | 1783 | | |
1784 | | - | |
1785 | | - | |
1786 | | - | |
| 1784 | + | |
| 1785 | + | |
1787 | 1786 | | |
1788 | 1787 | | |
1789 | 1788 | | |
| |||
1794 | 1793 | | |
1795 | 1794 | | |
1796 | 1795 | | |
1797 | | - | |
1798 | | - | |
1799 | | - | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
1800 | 1799 | | |
1801 | 1800 | | |
1802 | 1801 | | |
| |||
1807 | 1806 | | |
1808 | 1807 | | |
1809 | 1808 | | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
1813 | 1812 | | |
1814 | 1813 | | |
1815 | 1814 | | |
| |||
0 commit comments