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 28, 2024
1 parent 5dc80dd commit a3d94d5
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 @@ -1740,9 +1740,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 a3d94d5

Please sign in to comment.