[llvm] 7158f28 - [CostModel] Unify getCFInstrCost

Sam Parker via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 00:43:44 PDT 2020


Author: Sam Parker
Date: 2020-06-16T08:40:54+01:00
New Revision: 7158f285a8679626b9801bb2ace60d093d1cebff

URL: https://github.com/llvm/llvm-project/commit/7158f285a8679626b9801bb2ace60d093d1cebff
DIFF: https://github.com/llvm/llvm-project/commit/7158f285a8679626b9801bb2ace60d093d1cebff.diff

LOG: [CostModel] Unify getCFInstrCost

Have TTI::getInstructionThroughput call getUserCost for Br, Ret and
PHI. This now means that eveything in getInstructionThroughput is
handled by getUserCost.

Differential Revision: https://reviews.llvm.org/D79849

Added: 
    

Modified: 
    llvm/lib/Analysis/TargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 29a52035dfc1..116ff5ac167c 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -1225,13 +1225,9 @@ int TargetTransformInfo::getInstructionThroughput(const Instruction *I) const {
 
   switch (I->getOpcode()) {
   case Instruction::GetElementPtr:
-    return getUserCost(I, CostKind);
-
   case Instruction::Ret:
   case Instruction::PHI:
-  case Instruction::Br: {
-    return getCFInstrCost(I->getOpcode(), CostKind);
-  }
+  case Instruction::Br:
   case Instruction::Add:
   case Instruction::FAdd:
   case Instruction::Sub:
@@ -1251,7 +1247,6 @@ int TargetTransformInfo::getInstructionThroughput(const Instruction *I) const {
   case Instruction::Or:
   case Instruction::Xor:
   case Instruction::FNeg:
-    return getUserCost(I, CostKind);
   case Instruction::Select:
   case Instruction::ICmp:
   case Instruction::FCmp:


        


More information about the llvm-commits mailing list