[PATCH] D80994: [NFCI][CostModel][AMDGPU] Simplify getUserCost
Sam Parker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 04:58:38 PDT 2020
samparker created this revision.
samparker added reviewers: dfukalov, arsenm.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.
Casts and intrinsics are now handled by the default implementation of getUserCost, so remove them from the backends switch statement.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80994
Files:
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
Index: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -993,14 +993,6 @@
Idx = CI->getZExtValue();
return getVectorInstrCost(I->getOpcode(), I->getType(), Idx);
}
- case Instruction::Call: {
- if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(U)) {
- IntrinsicCostAttributes CostAttrs(*II);
- return getIntrinsicInstrCost(CostAttrs, CostKind);
- } else {
- return BaseT::getUserCost(U, Operands, CostKind);
- }
- }
case Instruction::ShuffleVector: {
const ShuffleVectorInst *Shuffle = cast<ShuffleVectorInst>(I);
auto *Ty = cast<VectorType>(Shuffle->getType());
@@ -1034,22 +1026,6 @@
return getShuffleCost(TTI::SK_PermuteTwoSrc, Ty, 0, nullptr);
}
- case Instruction::ZExt:
- case Instruction::SExt:
- case Instruction::FPToUI:
- case Instruction::FPToSI:
- case Instruction::FPExt:
- case Instruction::PtrToInt:
- case Instruction::IntToPtr:
- case Instruction::SIToFP:
- case Instruction::UIToFP:
- case Instruction::Trunc:
- case Instruction::FPTrunc:
- case Instruction::BitCast:
- case Instruction::AddrSpaceCast: {
- return getCastInstrCost(I->getOpcode(), I->getType(),
- I->getOperand(0)->getType(), CostKind, I);
- }
case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80994.267849.patch
Type: text/x-patch
Size: 1508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200602/4c664a23/attachment.bin>
More information about the llvm-commits
mailing list