@@ -1251,8 +1251,8 @@ class LoopVectorizationCostModel {
12511251 return false ;
12521252
12531253 // Get the source and destination types of the truncate.
1254- Type *SrcTy = ToVectorTy (cast<CastInst>(I)->getSrcTy (), VF);
1255- Type *DestTy = ToVectorTy (cast<CastInst>(I)->getDestTy (), VF);
1254+ Type *SrcTy = toVectorTy (cast<CastInst>(I)->getSrcTy (), VF);
1255+ Type *DestTy = toVectorTy (cast<CastInst>(I)->getDestTy (), VF);
12561256
12571257 // If the truncate is free for the given types, return false. Replacing a
12581258 // free truncate with an induction variable would add an induction variable
@@ -3535,14 +3535,14 @@ LoopVectorizationCostModel::getDivRemSpeculationCost(Instruction *I,
35353535 }
35363536 InstructionCost SafeDivisorCost = 0 ;
35373537
3538- auto *VecTy = ToVectorTy (I->getType (), VF);
3538+ auto *VecTy = toVectorTy (I->getType (), VF);
35393539
35403540 // The cost of the select guard to ensure all lanes are well defined
35413541 // after we speculate above any internal control flow.
3542- SafeDivisorCost += TTI. getCmpSelInstrCost (
3543- Instruction::Select, VecTy,
3544- ToVectorTy (Type::getInt1Ty (I->getContext ()), VF),
3545- CmpInst::BAD_ICMP_PREDICATE, CostKind);
3542+ SafeDivisorCost +=
3543+ TTI. getCmpSelInstrCost ( Instruction::Select, VecTy,
3544+ toVectorTy (Type::getInt1Ty (I->getContext ()), VF),
3545+ CmpInst::BAD_ICMP_PREDICATE, CostKind);
35463546
35473547 // Certain instructions can be cheaper to vectorize if they have a constant
35483548 // second vector operand. One example of this are shifts on x86.
@@ -4662,7 +4662,7 @@ static bool willGenerateVectors(VPlan &Plan, ElementCount VF,
46624662 }
46634663
46644664 auto WillWiden = [&TTI, VF](Type *ScalarTy) {
4665- Type *VectorTy = ToVectorTy (ScalarTy, VF);
4665+ Type *VectorTy = toVectorTy (ScalarTy, VF);
46664666 unsigned NumLegalParts = TTI.getNumberOfParts (VectorTy);
46674667 if (!NumLegalParts)
46684668 return false ;
@@ -5653,7 +5653,7 @@ InstructionCost LoopVectorizationCostModel::computePredInstDiscount(
56535653 TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
56545654 if (isScalarWithPredication (I, VF) && !I->getType ()->isVoidTy ()) {
56555655 ScalarCost += TTI.getScalarizationOverhead (
5656- cast<VectorType>(ToVectorTy (I->getType (), VF)),
5656+ cast<VectorType>(toVectorTy (I->getType (), VF)),
56575657 APInt::getAllOnes (VF.getFixedValue ()), /* Insert*/ true ,
56585658 /* Extract*/ false , CostKind);
56595659 ScalarCost +=
@@ -5672,7 +5672,7 @@ InstructionCost LoopVectorizationCostModel::computePredInstDiscount(
56725672 Worklist.push_back (J);
56735673 else if (needsExtract (J, VF)) {
56745674 ScalarCost += TTI.getScalarizationOverhead (
5675- cast<VectorType>(ToVectorTy (J->getType (), VF)),
5675+ cast<VectorType>(toVectorTy (J->getType (), VF)),
56765676 APInt::getAllOnes (VF.getFixedValue ()), /* Insert*/ false ,
56775677 /* Extract*/ true , CostKind);
56785678 }
@@ -5783,7 +5783,7 @@ LoopVectorizationCostModel::getMemInstScalarizationCost(Instruction *I,
57835783
57845784 unsigned AS = getLoadStoreAddressSpace (I);
57855785 Value *Ptr = getLoadStorePointerOperand (I);
5786- Type *PtrTy = ToVectorTy (Ptr->getType (), VF);
5786+ Type *PtrTy = toVectorTy (Ptr->getType (), VF);
57875787 // NOTE: PtrTy is a vector to signal `TTI::getAddressComputationCost`
57885788 // that it is being called from this specific place.
57895789
@@ -5834,7 +5834,7 @@ InstructionCost
58345834LoopVectorizationCostModel::getConsecutiveMemOpCost (Instruction *I,
58355835 ElementCount VF) {
58365836 Type *ValTy = getLoadStoreType (I);
5837- auto *VectorTy = cast<VectorType>(ToVectorTy (ValTy, VF));
5837+ auto *VectorTy = cast<VectorType>(toVectorTy (ValTy, VF));
58385838 Value *Ptr = getLoadStorePointerOperand (I);
58395839 unsigned AS = getLoadStoreAddressSpace (I);
58405840 int ConsecutiveStride = Legal->isConsecutivePtr (ValTy, Ptr);
@@ -5866,7 +5866,7 @@ LoopVectorizationCostModel::getUniformMemOpCost(Instruction *I,
58665866 assert (Legal->isUniformMemOp (*I, VF));
58675867
58685868 Type *ValTy = getLoadStoreType (I);
5869- auto *VectorTy = cast<VectorType>(ToVectorTy (ValTy, VF));
5869+ auto *VectorTy = cast<VectorType>(toVectorTy (ValTy, VF));
58705870 const Align Alignment = getLoadStoreAlignment (I);
58715871 unsigned AS = getLoadStoreAddressSpace (I);
58725872 enum TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
@@ -5892,7 +5892,7 @@ InstructionCost
58925892LoopVectorizationCostModel::getGatherScatterCost (Instruction *I,
58935893 ElementCount VF) {
58945894 Type *ValTy = getLoadStoreType (I);
5895- auto *VectorTy = cast<VectorType>(ToVectorTy (ValTy, VF));
5895+ auto *VectorTy = cast<VectorType>(toVectorTy (ValTy, VF));
58965896 const Align Alignment = getLoadStoreAlignment (I);
58975897 const Value *Ptr = getLoadStorePointerOperand (I);
58985898
@@ -5910,7 +5910,7 @@ LoopVectorizationCostModel::getInterleaveGroupCost(Instruction *I,
59105910
59115911 Instruction *InsertPos = Group->getInsertPos ();
59125912 Type *ValTy = getLoadStoreType (InsertPos);
5913- auto *VectorTy = cast<VectorType>(ToVectorTy (ValTy, VF));
5913+ auto *VectorTy = cast<VectorType>(toVectorTy (ValTy, VF));
59145914 unsigned AS = getLoadStoreAddressSpace (InsertPos);
59155915 enum TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
59165916
@@ -6155,7 +6155,7 @@ InstructionCost LoopVectorizationCostModel::getScalarizationOverhead(
61556155 return 0 ;
61566156
61576157 InstructionCost Cost = 0 ;
6158- Type *RetTy = ToVectorTy (I->getType (), VF);
6158+ Type *RetTy = toVectorTy (I->getType (), VF);
61596159 if (!RetTy->isVoidTy () &&
61606160 (!isa<LoadInst>(I) || !TTI.supportsEfficientVectorElementLoadStore ()))
61616161 Cost += TTI.getScalarizationOverhead (
@@ -6421,9 +6421,9 @@ void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {
64216421
64226422 bool MaskRequired = Legal->isMaskRequired (CI);
64236423 // Compute corresponding vector type for return value and arguments.
6424- Type *RetTy = ToVectorTy (ScalarRetTy, VF);
6424+ Type *RetTy = toVectorTy (ScalarRetTy, VF);
64256425 for (Type *ScalarTy : ScalarTys)
6426- Tys.push_back (ToVectorTy (ScalarTy, VF));
6426+ Tys.push_back (toVectorTy (ScalarTy, VF));
64276427
64286428 // An in-loop reduction using an fmuladd intrinsic is a special case;
64296429 // we don't want the normal cost for that intrinsic.
@@ -6613,7 +6613,7 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
66136613 HasSingleCopyAfterVectorization (I, VF));
66146614 VectorTy = RetTy;
66156615 } else
6616- VectorTy = ToVectorTy (RetTy, VF);
6616+ VectorTy = toVectorTy (RetTy, VF);
66176617
66186618 if (VF.isVector () && VectorTy->isVectorTy () &&
66196619 !TTI.getNumberOfParts (VectorTy))
@@ -6673,8 +6673,8 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
66736673 return Switch->getNumCases () *
66746674 TTI.getCmpSelInstrCost (
66756675 Instruction::ICmp,
6676- ToVectorTy (Switch->getCondition ()->getType (), VF),
6677- ToVectorTy (Type::getInt1Ty (I->getContext ()), VF),
6676+ toVectorTy (Switch->getCondition ()->getType (), VF),
6677+ toVectorTy (Type::getInt1Ty (I->getContext ()), VF),
66786678 CmpInst::ICMP_EQ, CostKind);
66796679 }
66806680 case Instruction::PHI: {
@@ -6719,8 +6719,8 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
67196719 }
67206720 return (Phi->getNumIncomingValues () - 1 ) *
67216721 TTI.getCmpSelInstrCost (
6722- Instruction::Select, ToVectorTy (ResultTy, VF),
6723- ToVectorTy (Type::getInt1Ty (Phi->getContext ()), VF),
6722+ Instruction::Select, toVectorTy (ResultTy, VF),
6723+ toVectorTy (Type::getInt1Ty (Phi->getContext ()), VF),
67246724 CmpInst::BAD_ICMP_PREDICATE, CostKind);
67256725 }
67266726
@@ -6729,8 +6729,8 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
67296729 if (VF.isVector () && foldTailWithEVL () &&
67306730 Legal->getReductionVars ().contains (Phi) && !isInLoopReduction (Phi)) {
67316731 IntrinsicCostAttributes ICA (
6732- Intrinsic::vp_merge, ToVectorTy (Phi->getType (), VF),
6733- {ToVectorTy (Type::getInt1Ty (Phi->getContext ()), VF)});
6732+ Intrinsic::vp_merge, toVectorTy (Phi->getType (), VF),
6733+ {toVectorTy (Type::getInt1Ty (Phi->getContext ()), VF)});
67346734 return TTI.getIntrinsicInstrCost (ICA, CostKind);
67356735 }
67366736
@@ -6870,7 +6870,7 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
68706870 ValTy = IntegerType::get (ValTy->getContext (), MinBWs[I]);
68716871 }
68726872
6873- VectorTy = ToVectorTy (ValTy, VF);
6873+ VectorTy = toVectorTy (ValTy, VF);
68746874 return TTI.getCmpSelInstrCost (I->getOpcode (), VectorTy, nullptr ,
68756875 cast<CmpInst>(I)->getPredicate (), CostKind,
68766876 {TTI::OK_AnyValue, TTI::OP_None},
@@ -6888,7 +6888,7 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
68886888 if (Decision == CM_Scalarize)
68896889 Width = ElementCount::getFixed (1 );
68906890 }
6891- VectorTy = ToVectorTy (getLoadStoreType (I), Width);
6891+ VectorTy = toVectorTy (getLoadStoreType (I), Width);
68926892 return getMemoryInstructionCost (I, VF);
68936893 }
68946894 case Instruction::BitCast:
@@ -6969,7 +6969,7 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I,
69696969 SrcScalarTy =
69706970 IntegerType::get (SrcScalarTy->getContext (), MinBWs[Op0AsInstruction]);
69716971 Type *SrcVecTy =
6972- VectorTy->isVectorTy () ? ToVectorTy (SrcScalarTy, VF) : SrcScalarTy;
6972+ VectorTy->isVectorTy () ? toVectorTy (SrcScalarTy, VF) : SrcScalarTy;
69736973
69746974 if (canTruncateToMinimalBitwidth (I, VF)) {
69756975 // If the result type is <= the source type, there will be no extend
@@ -7498,7 +7498,7 @@ LoopVectorizationPlanner::precomputeCosts(VPlan &Plan, ElementCount VF,
74987498 // Pre-compute the cost for I, if it has a reduction pattern cost.
74997499 for (Instruction *I : ChainOpsAndOperands) {
75007500 auto ReductionCost = CM.getReductionPatternCost (
7501- I, VF, ToVectorTy (I->getType (), VF), TTI::TCK_RecipThroughput);
7501+ I, VF, toVectorTy (I->getType (), VF), TTI::TCK_RecipThroughput);
75027502 if (!ReductionCost)
75037503 continue ;
75047504
0 commit comments