Skip to content

Commit cc81a60

Browse files
committed
Move Type equivalence earlier (cheap checks first)
1 parent 381e991 commit cc81a60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,9 +1742,9 @@ bool VectorCombine::foldShuffleOfBinops(Instruction &I) {
17421742
ArrayRef<int> InnerMask;
17431743
if (match(Op, m_OneUse(m_Shuffle(m_Value(InnerOp), m_Undef(),
17441744
m_Mask(InnerMask)))) &&
1745+
InnerOp->getType() == Op->getType() &&
17451746
all_of(InnerMask,
1746-
[NumSrcElts](int M) { return M < (int)NumSrcElts; }) &&
1747-
InnerOp->getType() == Op->getType()) {
1747+
[NumSrcElts](int M) { return M < (int)NumSrcElts; })) {
17481748
for (int &M : Mask)
17491749
if (Offset <= M && M < (int)(Offset + NumSrcElts)) {
17501750
M = InnerMask[M - Offset];

0 commit comments

Comments
 (0)