Commit 41466a1
authored
[SelectionDAG] Correct the implementation of m_AllOnes. (#90776)
Previously we used SpecificInt_match which created a 64 bit APInt
containing all ones. This was then checked against other constants by
using APInt::isSameValue.
If the constnats have different bitwidths, APInt::isSameValue will zero
extend the constant to make them match. This means for any constant less
than 64 bits, m_AllOnes was guaranteed to fail since the zero extended
value would not match all ones.
I think would also incorrectly consider an i128 with 64 leading zeros
and 64 trailing zeros as matching m_AllOnes.
To avoid this, this patch adds a new matcher class that just calls
isAllOnesOrAllOnesSplat.1 parent c2d8926 commit 41466a1
File tree
2 files changed
+105
-387
lines changed- llvm
- include/llvm/CodeGen
- test/CodeGen/X86
2 files changed
+105
-387
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
719 | | - | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
720 | 730 | | |
721 | 731 | | |
722 | 732 | | |
| |||
766 | 776 | | |
767 | 777 | | |
768 | 778 | | |
769 | | - | |
| 779 | + | |
770 | 780 | | |
771 | 781 | | |
772 | 782 | | |
| |||
0 commit comments