Skip to content

Commit 42b4bf4

Browse files
committed
add early return when if type of C1 != C2
1 parent 4e9e6a8 commit 42b4bf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ bool VectorCombine::foldShuffleOfSelects(Instruction &I) {
19151915
auto *DstVecTy = dyn_cast<FixedVectorType>(I.getType());
19161916
auto *C1VecTy = dyn_cast<FixedVectorType>(C1->getType());
19171917
auto *C2VecTy = dyn_cast<FixedVectorType>(C2->getType());
1918-
if (!C1VecTy || !C2VecTy)
1918+
if (!C1VecTy || !C2VecTy || C1VecTy != C2VecTy)
19191919
return false;
19201920

19211921
// SelectInsts must have the same FMF.

0 commit comments

Comments
 (0)