[llvm] 5e2c736 - [SVE] Remove calls to VectorType::getNumElements from WebASM
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 22 12:25:31 PDT 2020
Author: Christopher Tetreault
Date: 2020-06-22T12:25:08-07:00
New Revision: 5e2c736395cc44a00c8c2cc9fc916450bf780fbe
URL: https://github.com/llvm/llvm-project/commit/5e2c736395cc44a00c8c2cc9fc916450bf780fbe
DIFF: https://github.com/llvm/llvm-project/commit/5e2c736395cc44a00c8c2cc9fc916450bf780fbe.diff
LOG: [SVE] Remove calls to VectorType::getNumElements from WebASM
Summary:
The getNumElements in base VectorType is being deprecated.
See: http://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html
Reviewers: efriedma, tlively, fpetrogalli, c-rhodes, dschuff
Reviewed By: tlively, dschuff
Subscribers: dschuff, sbc100, tschuett, jgravelle-google, hiraditya, aheejin, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82217
Added:
Modified:
llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
index 9f767d391122..28703a2787e0 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp
@@ -63,10 +63,11 @@ unsigned WebAssemblyTTIImpl::getArithmeticInstrCost(
// approxmation.
if (Opd2Info != TTI::OK_UniformValue &&
Opd2Info != TTI::OK_UniformConstantValue)
- Cost = VTy->getNumElements() *
- (TargetTransformInfo::TCC_Basic +
- getArithmeticInstrCost(Opcode, VTy->getElementType(), CostKind) +
- TargetTransformInfo::TCC_Basic);
+ Cost =
+ cast<FixedVectorType>(VTy)->getNumElements() *
+ (TargetTransformInfo::TCC_Basic +
+ getArithmeticInstrCost(Opcode, VTy->getElementType(), CostKind) +
+ TargetTransformInfo::TCC_Basic);
break;
}
}
More information about the llvm-commits
mailing list