diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index d11d74a4a079..3c95b2ecc07d 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -6959,7 +6959,7 @@ static bool splitMergedValStore(StoreInst &SI, const DataLayout &DL, // whereas scalable vectors would have to be shifted by // <2log(vscale) + number of bits> in order to store the // low/high parts. Bailing out for now. - if (StoreType->isVectorTy() && cast(StoreType)->isScalable()) + if (isa(StoreType)) return false; if (!DL.typeSizeEqualsStoreSize(StoreType) || diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 7a8943340c17..9b97d5990cc8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -161,7 +161,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, // Scalable vectors may need a special StackID to distinguish // them from other (fixed size) stack objects. - if (Ty->isVectorTy() && cast(Ty)->isScalable()) + if (isa(Ty)) MF->getFrameInfo().setStackID(FrameIndex, TFI->getStackIDForScalableVectors()); diff --git a/llvm/lib/CodeGen/ValueTypes.cpp b/llvm/lib/CodeGen/ValueTypes.cpp index ae2606f8dba6..55dfabfaf6fe 100644 --- a/llvm/lib/CodeGen/ValueTypes.cpp +++ b/llvm/lib/CodeGen/ValueTypes.cpp @@ -103,11 +103,11 @@ bool EVT::isExtended2048BitVector() const { } bool EVT::isExtendedFixedLengthVector() const { - return isExtendedVector() && !cast(LLVMTy)->isScalable(); + return isExtendedVector() && isa(LLVMTy); } bool EVT::isExtendedScalableVector() const { - return isExtendedVector() && cast(LLVMTy)->isScalable(); + return isExtendedVector() && isa(LLVMTy); } EVT EVT::getExtendedVectorElementType() const { diff --git a/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp b/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp index 9a4e049f635a..81c99163229a 100644 --- a/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp +++ b/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp @@ -114,7 +114,7 @@ TEST(ScalableVectorMVTsTest, VTToIRTranslation) { Type *Ty = Enxv4f64.getTypeForEVT(Ctx); VectorType *ScV4Float64Ty = cast(Ty); - ASSERT_TRUE(ScV4Float64Ty->isScalable()); + ASSERT_TRUE(isa(ScV4Float64Ty)); ASSERT_EQ(Enxv4f64.getVectorElementCount(), ScV4Float64Ty->getElementCount()); ASSERT_EQ(Enxv4f64.getScalarType().getTypeForEVT(Ctx), ScV4Float64Ty->getElementType());