Skip to content

Commit

Permalink
[SVE] Remove calls to isScalable from CodeGen
Browse files Browse the repository at this point in the history
Reviewers: efriedma, sdesmalen, stoklund, sunfish

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77755
  • Loading branch information
christetreault-llvm committed Apr 23, 2020
1 parent 9174e02 commit ccd623e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/CodeGenPrepare.cpp
Expand Up @@ -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<VectorType>(StoreType)->isScalable())
if (isa<ScalableVectorType>(StoreType))
return false;

if (!DL.typeSizeEqualsStoreSize(StoreType) ||
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
Expand Up @@ -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<VectorType>(Ty)->isScalable())
if (isa<ScalableVectorType>(Ty))
MF->getFrameInfo().setStackID(FrameIndex,
TFI->getStackIDForScalableVectors());

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/ValueTypes.cpp
Expand Up @@ -103,11 +103,11 @@ bool EVT::isExtended2048BitVector() const {
}

bool EVT::isExtendedFixedLengthVector() const {
return isExtendedVector() && !cast<VectorType>(LLVMTy)->isScalable();
return isExtendedVector() && isa<FixedVectorType>(LLVMTy);
}

bool EVT::isExtendedScalableVector() const {
return isExtendedVector() && cast<VectorType>(LLVMTy)->isScalable();
return isExtendedVector() && isa<ScalableVectorType>(LLVMTy);
}

EVT EVT::getExtendedVectorElementType() const {
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp
Expand Up @@ -114,7 +114,7 @@ TEST(ScalableVectorMVTsTest, VTToIRTranslation) {

Type *Ty = Enxv4f64.getTypeForEVT(Ctx);
VectorType *ScV4Float64Ty = cast<VectorType>(Ty);
ASSERT_TRUE(ScV4Float64Ty->isScalable());
ASSERT_TRUE(isa<ScalableVectorType>(ScV4Float64Ty));
ASSERT_EQ(Enxv4f64.getVectorElementCount(), ScV4Float64Ty->getElementCount());
ASSERT_EQ(Enxv4f64.getScalarType().getTypeForEVT(Ctx),
ScV4Float64Ty->getElementType());
Expand Down

0 comments on commit ccd623e

Please sign in to comment.