From e3b557809604d036af6e00c60f012c2025b59a5e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 11 Feb 2023 13:38:04 +0100 Subject: Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41, the last commit before the upstream release/17.x branch was created. --- .../WebAssembly/WebAssemblyTargetTransformInfo.cpp | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp') diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp index 62f7155e794a..9a434d9b1db5 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetTransformInfo.cpp @@ -52,14 +52,13 @@ TypeSize WebAssemblyTTIImpl::getRegisterBitWidth( InstructionCost WebAssemblyTTIImpl::getArithmeticInstrCost( unsigned Opcode, Type *Ty, TTI::TargetCostKind CostKind, - TTI::OperandValueKind Opd1Info, TTI::OperandValueKind Opd2Info, - TTI::OperandValueProperties Opd1PropInfo, - TTI::OperandValueProperties Opd2PropInfo, ArrayRef Args, + TTI::OperandValueInfo Op1Info, TTI::OperandValueInfo Op2Info, + ArrayRef Args, const Instruction *CxtI) { InstructionCost Cost = BasicTTIImplBase::getArithmeticInstrCost( - Opcode, Ty, CostKind, Opd1Info, Opd2Info, Opd1PropInfo, Opd2PropInfo); + Opcode, Ty, CostKind, Op1Info, Op2Info); if (auto *VTy = dyn_cast(Ty)) { switch (Opcode) { @@ -68,9 +67,8 @@ InstructionCost WebAssemblyTTIImpl::getArithmeticInstrCost( case Instruction::Shl: // SIMD128's shifts currently only accept a scalar shift count. For each // element, we'll need to extract, op, insert. The following is a rough - // approxmation. - if (Opd2Info != TTI::OK_UniformValue && - Opd2Info != TTI::OK_UniformConstantValue) + // approximation. + if (!Op2Info.isUniform()) Cost = cast(VTy)->getNumElements() * (TargetTransformInfo::TCC_Basic + @@ -82,11 +80,12 @@ InstructionCost WebAssemblyTTIImpl::getArithmeticInstrCost( return Cost; } -InstructionCost WebAssemblyTTIImpl::getVectorInstrCost(unsigned Opcode, - Type *Val, - unsigned Index) { - InstructionCost Cost = - BasicTTIImplBase::getVectorInstrCost(Opcode, Val, Index); +InstructionCost +WebAssemblyTTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val, + TTI::TargetCostKind CostKind, + unsigned Index, Value *Op0, Value *Op1) { + InstructionCost Cost = BasicTTIImplBase::getVectorInstrCost( + Opcode, Val, CostKind, Index, Op0, Op1); // SIMD128's insert/extract currently only take constant indices. if (Index == -1u) -- cgit v1.2.3