Commit 8511a8d
[InstCombine] canonicalizeSaturatedAdd(): last fold is only valid for strict comparison (PR48390)
We could create uadd.sat under incorrect circumstances
if a select with -1 as the false value was canonicalized
by swapping the T/F values. Unlike the other transforms
in the same function, it is not invariant to equality.
Some alive proofs: https://alive2.llvm.org/ce/z/emmKKL
Based on original patch by David Green!
Fixes https://bugs.llvm.org/show_bug.cgi?id=48390
Differential Revision: https://reviews.llvm.org/D92717
(cherry picked from commit e6f2a79)1 parent 934376d commit 8511a8d
File tree
2 files changed
+27
-17
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
2 files changed
+27
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
786 | | - | |
787 | | - | |
| 785 | + | |
788 | 786 | | |
789 | 787 | | |
790 | | - | |
| 788 | + | |
791 | 789 | | |
792 | 790 | | |
793 | 791 | | |
794 | 792 | | |
795 | | - | |
796 | | - | |
797 | | - | |
| 793 | + | |
| 794 | + | |
798 | 795 | | |
| 796 | + | |
799 | 797 | | |
800 | | - | |
| 798 | + | |
801 | 799 | | |
802 | 800 | | |
803 | 801 | | |
| 802 | + | |
804 | 803 | | |
805 | 804 | | |
806 | 805 | | |
| |||
809 | 808 | | |
810 | 809 | | |
811 | 810 | | |
| 811 | + | |
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | | - | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
823 | 825 | | |
824 | 826 | | |
825 | 827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1804 | 1804 | | |
1805 | 1805 | | |
1806 | 1806 | | |
1807 | | - | |
1808 | | - | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
1809 | 1811 | | |
1810 | 1812 | | |
1811 | 1813 | | |
| |||
1826 | 1828 | | |
1827 | 1829 | | |
1828 | 1830 | | |
1829 | | - | |
1830 | | - | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
1831 | 1835 | | |
1832 | 1836 | | |
1833 | 1837 | | |
| |||
1848 | 1852 | | |
1849 | 1853 | | |
1850 | 1854 | | |
1851 | | - | |
1852 | | - | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1853 | 1859 | | |
1854 | 1860 | | |
1855 | 1861 | | |
| |||
1870 | 1876 | | |
1871 | 1877 | | |
1872 | 1878 | | |
1873 | | - | |
1874 | | - | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
1875 | 1883 | | |
1876 | 1884 | | |
1877 | 1885 | | |
| |||
0 commit comments