[llvm] 3d123e1 - [SVE] Remove calls to VectorType::getNumElements from IPO
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 24 13:39:15 PDT 2020
Author: Christopher Tetreault
Date: 2020-06-24T13:38:51-07:00
New Revision: 3d123e17d84ea4062a10d6b2ef0426fdb7c90158
URL: https://github.com/llvm/llvm-project/commit/3d123e17d84ea4062a10d6b2ef0426fdb7c90158
DIFF: https://github.com/llvm/llvm-project/commit/3d123e17d84ea4062a10d6b2ef0426fdb7c90158.diff
LOG: [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
Added:
Modified:
llvm/lib/Transforms/IPO/GlobalOpt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 47ac7eb613a7..116e68b783b7 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -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));
}
More information about the llvm-commits
mailing list