[llvm] 49fd24f - Clean up usages of asserting vector getters in Type
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 8 16:11:12 PDT 2020
Author: Christopher Tetreault
Date: 2020-04-08T16:10:55-07:00
New Revision: 49fd24fe9e45cade2763acbce59e683aebc3d13a
URL: https://github.com/llvm/llvm-project/commit/49fd24fe9e45cade2763acbce59e683aebc3d13a
DIFF: https://github.com/llvm/llvm-project/commit/49fd24fe9e45cade2763acbce59e683aebc3d13a.diff
LOG: Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: hfinkel, efriedma, sdesmalen
Reviewed By: efriedma
Subscribers: wuzish, nemanjai, hiraditya, kbarton, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77266
Added:
Modified:
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
index db570970b4fb..85555b109a3f 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -901,7 +901,7 @@ int PPCTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
// stores, loads are expanded using the vector-load + permutation sequence,
// which is much less expensive).
if (Src->isVectorTy() && Opcode == Instruction::Store)
- for (int i = 0, e = Src->getVectorNumElements(); i < e; ++i)
+ for (int i = 0, e = cast<VectorType>(Src)->getNumElements(); i < e; ++i)
Cost += getVectorInstrCost(Instruction::ExtractElement, Src, i);
return Cost;
More information about the llvm-commits
mailing list