Skip to content

Commit 2883558

Browse files
committed
add checking SrcVec is FixedVectorType
1 parent d1d1af2 commit 2883558

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
@@ -666,9 +666,9 @@ bool VectorCombine::foldInsExtFNeg(Instruction &I) {
666666
return false;
667667

668668
auto *VecTy = cast<FixedVectorType>(I.getType());
669-
auto *SrcVecTy = cast<FixedVectorType>(SrcVec->getType());
669+
auto *SrcVecTy = dyn_cast<FixedVectorType>(SrcVec->getType());
670670
auto *ScalarTy = SrcVecTy->getScalarType();
671-
if (ScalarTy != VecTy->getScalarType())
671+
if (!SrcVecTy || ScalarTy != SrcVecTy->getScalarType())
672672
return false;
673673

674674
// Ignore bogus insert/extract index.

0 commit comments

Comments
 (0)