Commit 3d123e17 authored by Christopher Tetreault's avatar Christopher Tetreault
Browse files

[SVE] Remove calls to VectorType::getNumElements from IPO

Reviewers: efriedma, jdoerfert, sdesmalen, kmclaughlin

Reviewed By: efriedma, jdoerfert

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82219
parent 58de2a38
......@@ -443,7 +443,7 @@ static bool IsSRASequential(Type *T) {
static uint64_t GetSRASequentialNumElements(Type *T) {
if (ArrayType *AT = dyn_cast<ArrayType>(T))
return AT->getNumElements();
return cast<VectorType>(T)->getNumElements();
return cast<FixedVectorType>(T)->getNumElements();
}
static Type *GetSRASequentialElementType(Type *T) {
if (ArrayType *AT = dyn_cast<ArrayType>(T))
......@@ -2570,7 +2570,7 @@ static Constant *EvaluateStoreInto(Constant *Init, Constant *Val,
if (ArrayType *ATy = dyn_cast<ArrayType>(Init->getType()))
NumElts = ATy->getNumElements();
else
NumElts = cast<VectorType>(Init->getType())->getNumElements();
NumElts = cast<FixedVectorType>(Init->getType())->getNumElements();
// Break up the array into elements.
for (uint64_t i = 0, e = NumElts; i != e; ++i)
......@@ -2706,7 +2706,7 @@ static void BatchCommitValueTo(const DenseMap<Constant*, Constant*> &Mem) {
else if (auto *ATy = dyn_cast<ArrayType>(Ty))
NumElts = ATy->getNumElements();
else
NumElts = cast<VectorType>(Ty)->getNumElements();
NumElts = cast<FixedVectorType>(Ty)->getNumElements();
for (unsigned i = 0, e = NumElts; i != e; ++i)
Elts.push_back(Init->getAggregateElement(i));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment