[llvm] cf2072b - [X86] X86TargetTransformInfo.cpp - use InstructionCost type to accumulate instructions costs

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 04:21:20 PDT 2022


Author: Simon Pilgrim
Date: 2022-06-15T12:21:01+01:00
New Revision: cf2072bcadafc72d839741d24fd91525d853df60

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

LOG: [X86] X86TargetTransformInfo.cpp - use InstructionCost type to accumulate instructions costs

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 2adbdcb693d5..4343552fe7e5 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -2623,7 +2623,7 @@ InstructionCost X86TTIImpl::getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
   int ISD = TLI->InstructionOpcodeToISD(Opcode);
   assert(ISD && "Invalid opcode");
 
-  unsigned ExtraCost = 0;
+  InstructionCost ExtraCost = 0;
   if (Opcode == Instruction::ICmp || Opcode == Instruction::FCmp) {
     // Some vector comparison predicates cost extra instructions.
     // TODO: Should we invert this and assume worst case cmp costs
@@ -3654,7 +3654,7 @@ InstructionCost X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
 
   assert(Val->isVectorTy() && "This must be a vector type");
   Type *ScalarType = Val->getScalarType();
-  int RegisterFileMoveCost = 0;
+  InstructionCost RegisterFileMoveCost = 0;
 
   // Non-immediate extraction/insertion can be handled as a sequence of
   // aliased loads+stores via the stack.


        


More information about the llvm-commits mailing list