Skip to content

Commit

Permalink
Move Type equivalence earlier (cheap checks first)
Browse files Browse the repository at this point in the history
  • Loading branch information
RKSimon committed Dec 30, 2024
1 parent 381e991 commit cc81a60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Vectorize/VectorCombine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,9 +1742,9 @@ bool VectorCombine::foldShuffleOfBinops(Instruction &I) {
ArrayRef<int> InnerMask;
if (match(Op, m_OneUse(m_Shuffle(m_Value(InnerOp), m_Undef(),
m_Mask(InnerMask)))) &&
InnerOp->getType() == Op->getType() &&
all_of(InnerMask,
[NumSrcElts](int M) { return M < (int)NumSrcElts; }) &&
InnerOp->getType() == Op->getType()) {
[NumSrcElts](int M) { return M < (int)NumSrcElts; })) {
for (int &M : Mask)
if (Offset <= M && M < (int)(Offset + NumSrcElts)) {
M = InnerMask[M - Offset];
Expand Down

0 comments on commit cc81a60

Please sign in to comment.