From 6f24ebc4badfebce72b6bf06a4dae82ac409da35 Mon Sep 17 00:00:00 2001 From: Sam Parker Date: Tue, 2 Jun 2020 12:29:42 +0100 Subject: [PATCH] [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 --- .../Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | 24 ---------------------- 1 file changed, 24 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp index 9e738dd..094fb5f7 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 Operands, Idx = CI->getZExtValue(); return getVectorInstrCost(I->getOpcode(), I->getType(), Idx); } - case Instruction::Call: { - if (const IntrinsicInst *II = dyn_cast(U)) { - IntrinsicCostAttributes CostAttrs(*II); - return getIntrinsicInstrCost(CostAttrs, CostKind); - } else { - return BaseT::getUserCost(U, Operands, CostKind); - } - } case Instruction::ShuffleVector: { const ShuffleVectorInst *Shuffle = cast(I); auto *Ty = cast(Shuffle->getType()); @@ -1034,22 +1026,6 @@ GCNTTIImpl::getUserCost(const User *U, ArrayRef 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: -- 2.7.4