@@ -49,7 +49,7 @@ static Constant *BitCastConstantVector(Constant *CV, VectorType *DstTy) {
49
49
50
50
// Do not iterate on scalable vector. The num of elements is unknown at
51
51
// compile-time.
52
- if (DstTy-> isScalable ( ))
52
+ if (isa<ScalableVectorType>(DstTy ))
53
53
return nullptr ;
54
54
55
55
// If this cast changes element count then we can't handle it here:
@@ -848,7 +848,7 @@ Constant *llvm::ConstantFoldInsertElementInstruction(Constant *Val,
848
848
// Do not iterate on scalable vector. The num of elements is unknown at
849
849
// compile-time.
850
850
VectorType *ValTy = cast<VectorType>(Val->getType ());
851
- if (ValTy-> isScalable ( ))
851
+ if (isa<ScalableVectorType>(ValTy ))
852
852
return nullptr ;
853
853
854
854
unsigned NumElts = cast<VectorType>(Val->getType ())->getNumElements ();
@@ -876,7 +876,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
876
876
ArrayRef<int > Mask) {
877
877
auto *V1VTy = cast<VectorType>(V1->getType ());
878
878
unsigned MaskNumElts = Mask.size ();
879
- ElementCount MaskEltCount = {MaskNumElts, V1VTy-> isScalable ( )};
879
+ ElementCount MaskEltCount = {MaskNumElts, isa<ScalableVectorType>(V1VTy )};
880
880
Type *EltTy = V1VTy->getElementType ();
881
881
882
882
// Undefined shuffle mask -> undefined value.
@@ -895,7 +895,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
895
895
}
896
896
// Do not iterate on scalable vector. The num of elements is unknown at
897
897
// compile-time.
898
- if (V1VTy-> isScalable ( ))
898
+ if (isa<ScalableVectorType>(V1VTy ))
899
899
return nullptr ;
900
900
901
901
unsigned SrcNumElts = V1VTy->getNumElements ();
@@ -972,8 +972,7 @@ Constant *llvm::ConstantFoldUnaryInstruction(unsigned Opcode, Constant *C) {
972
972
973
973
// Handle scalar UndefValue and scalable vector UndefValue. Fixed-length
974
974
// vectors are always evaluated per element.
975
- bool IsScalableVector = isa<VectorType>(C->getType ()) &&
976
- cast<VectorType>(C->getType ())->isScalable ();
975
+ bool IsScalableVector = isa<ScalableVectorType>(C->getType ());
977
976
bool HasScalarUndefOrScalableVectorUndef =
978
977
(!C->getType ()->isVectorTy () || IsScalableVector) && isa<UndefValue>(C);
979
978
@@ -1046,8 +1045,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1,
1046
1045
1047
1046
// Handle scalar UndefValue and scalable vector UndefValue. Fixed-length
1048
1047
// vectors are always evaluated per element.
1049
- bool IsScalableVector = isa<VectorType>(C1->getType ()) &&
1050
- cast<VectorType>(C1->getType ())->isScalable ();
1048
+ bool IsScalableVector = isa<ScalableVectorType>(C1->getType ());
1051
1049
bool HasScalarUndefOrScalableVectorUndef =
1052
1050
(!C1->getType ()->isVectorTy () || IsScalableVector) &&
1053
1051
(isa<UndefValue>(C1) || isa<UndefValue>(C2));
@@ -2000,7 +1998,7 @@ Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred,
2000
1998
2001
1999
// Do not iterate on scalable vector. The number of elements is unknown at
2002
2000
// compile-time.
2003
- if (C1VTy-> isScalable ( ))
2001
+ if (isa<ScalableVectorType>(C1VTy ))
2004
2002
return nullptr ;
2005
2003
2006
2004
// Fast path for splatted constants.
0 commit comments