[llvm] 6f24ebc - [NFCI][CostModel][AMDGPU] Simplify getUserCost
Sam Parker via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 00:51:50 PDT 2020
Author: Sam Parker
Date: 2020-06-04T08:51:28+01:00
New Revision: 6f24ebc4badfebce72b6bf06a4dae82ac409da35
URL: https://github.com/llvm/llvm-project/commit/6f24ebc4badfebce72b6bf06a4dae82ac409da35
DIFF: https://github.com/llvm/llvm-project/commit/6f24ebc4badfebce72b6bf06a4dae82ac409da35.diff
LOG: [NFCI][CostModel][AMDGPU] Simplify getUserCost
Casts and intrinsics are now handled by the default implementation
of getUserCost, so remove them from the backends switch statement.
https://reviews.llvm.org/D80994
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index 9e738dd6fdb3..094fb5f7b4d0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -993,14 +993,6 @@ GCNTTIImpl::getUserCost(const User *U, ArrayRef<const Value *> Operands,
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 @@ GCNTTIImpl::getUserCost(const User *U, ArrayRef<const Value *> Operands,
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:
More information about the llvm-commits
mailing list