@@ -6824,20 +6824,18 @@ int LoopVectorizationCostModel::computePredInstDiscount(
6824
6824
// the instruction as if it wasn't if-converted and instead remained in the
6825
6825
// predicated block. We will scale this cost by block probability after
6826
6826
// computing the scalarization overhead.
6827
- assert (!VF.isScalable () && " scalable vectors not yet supported." );
6828
6827
InstructionCost ScalarCost =
6829
- VF.getKnownMinValue () *
6828
+ VF.getFixedValue () *
6830
6829
getInstructionCost (I, ElementCount::getFixed (1 )).first ;
6831
6830
6832
6831
// Compute the scalarization overhead of needed insertelement instructions
6833
6832
// and phi nodes.
6834
6833
if (isScalarWithPredication (I) && !I->getType ()->isVoidTy ()) {
6835
6834
ScalarCost += TTI.getScalarizationOverhead (
6836
6835
cast<VectorType>(ToVectorTy (I->getType (), VF)),
6837
- APInt::getAllOnesValue (VF.getKnownMinValue ()), true , false );
6838
- assert (!VF.isScalable () && " scalable vectors not yet supported." );
6836
+ APInt::getAllOnesValue (VF.getFixedValue ()), true , false );
6839
6837
ScalarCost +=
6840
- VF.getKnownMinValue () *
6838
+ VF.getFixedValue () *
6841
6839
TTI.getCFInstrCost (Instruction::PHI, TTI::TCK_RecipThroughput);
6842
6840
}
6843
6841
@@ -6852,10 +6850,9 @@ int LoopVectorizationCostModel::computePredInstDiscount(
6852
6850
if (canBeScalarized (J))
6853
6851
Worklist.push_back (J);
6854
6852
else if (needsExtract (J, VF)) {
6855
- assert (!VF.isScalable () && " scalable vectors not yet supported." );
6856
6853
ScalarCost += TTI.getScalarizationOverhead (
6857
6854
cast<VectorType>(ToVectorTy (J->getType (), VF)),
6858
- APInt::getAllOnesValue (VF.getKnownMinValue ()), false , true );
6855
+ APInt::getAllOnesValue (VF.getFixedValue ()), false , true );
6859
6856
}
6860
6857
}
6861
6858
@@ -7550,14 +7547,13 @@ LoopVectorizationCostModel::getInstructionCost(Instruction *I, ElementCount VF,
7550
7547
7551
7548
if (ScalarPredicatedBB) {
7552
7549
// Return cost for branches around scalarized and predicated blocks.
7553
- assert (!VF.isScalable () && " scalable vectors not yet supported." );
7554
7550
auto *Vec_i1Ty =
7555
7551
VectorType::get (IntegerType::getInt1Ty (RetTy->getContext ()), VF);
7556
- return (TTI. getScalarizationOverhead (
7557
- Vec_i1Ty, APInt::getAllOnesValue (VF. getKnownMinValue ()),
7558
- false , true ) +
7559
- (TTI. getCFInstrCost (Instruction::Br, CostKind) *
7560
- VF.getKnownMinValue ()));
7552
+ return (
7553
+ TTI. getScalarizationOverhead (
7554
+ Vec_i1Ty, APInt::getAllOnesValue (VF. getFixedValue ()), false ,
7555
+ true ) +
7556
+ (TTI. getCFInstrCost (Instruction::Br, CostKind) * VF.getFixedValue ()));
7561
7557
} else if (I->getParent () == TheLoop->getLoopLatch () || VF.isScalar ())
7562
7558
// The back-edge branch will remain, as will all scalar branches.
7563
7559
return TTI.getCFInstrCost (Instruction::Br, CostKind);
0 commit comments