Unverified Commit 41466a17 authored by Craig Topper's avatar Craig Topper Committed by GitHub
Browse files

[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.
parent c2d89266
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment