Skip to content

Commit 5e2c736

Browse files
[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
1 parent bebea42 commit 5e2c736

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ unsigned WebAssemblyTTIImpl::getArithmeticInstrCost(
6363
// approxmation.
6464
if (Opd2Info != TTI::OK_UniformValue &&
6565
Opd2Info != TTI::OK_UniformConstantValue)
66-
Cost = VTy->getNumElements() *
67-
(TargetTransformInfo::TCC_Basic +
68-
getArithmeticInstrCost(Opcode, VTy->getElementType(), CostKind) +
69-
TargetTransformInfo::TCC_Basic);
66+
Cost =
67+
cast<FixedVectorType>(VTy)->getNumElements() *
68+
(TargetTransformInfo::TCC_Basic +
69+
getArithmeticInstrCost(Opcode, VTy->getElementType(), CostKind) +
70+
TargetTransformInfo::TCC_Basic);
7071
break;
7172
}
7273
}

0 commit comments

Comments
 (0)