Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information