diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 6f9475da8c0ae8..f81d0971b4c525 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -6970,9 +6970,9 @@ class VectorPromoteHelper { // The scalar chain of computation has to pay for the transition // scalar to vector. // The vector chain has to account for the combining cost. - uint64_t ScalarCost = + InstructionCost ScalarCost = TTI.getVectorInstrCost(Transition->getOpcode(), PromotedType, Index); - uint64_t VectorCost = StoreExtractCombineCost; + InstructionCost VectorCost = StoreExtractCombineCost; enum TargetTransformInfo::TargetCostKind CostKind = TargetTransformInfo::TCK_RecipThroughput; for (const auto &Inst : InstsToBePromoted) { diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 62e80cc9de5921..ead0c6103bb843 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -6811,7 +6811,7 @@ InstructionCost LoopVectorizationCostModel::getReductionPatternCost( unsigned ExtCost = TTI.getCastInstrCost(Op0->getOpcode(), VectorTy, ExtType, TTI::CastContextHint::None, CostKind, Op0); - unsigned MulCost = + InstructionCost MulCost = TTI.getArithmeticInstrCost(Mul->getOpcode(), VectorTy, CostKind); InstructionCost RedCost = TTI.getExtendedAddReductionCost( @@ -6821,7 +6821,7 @@ InstructionCost LoopVectorizationCostModel::getReductionPatternCost( if (RedCost.isValid() && RedCost < ExtCost * 2 + MulCost + BaseCost) return I == RetI ? *RedCost.getValue() : 0; } else { - unsigned MulCost = + InstructionCost MulCost = TTI.getArithmeticInstrCost(Mul->getOpcode(), VectorTy, CostKind); InstructionCost RedCost = TTI.getExtendedAddReductionCost(