Skip to content

Commit d84be8a

Browse files
committed
[VPlan] Get Cmp cost via getCostForRecipeWithOp for VPReplicateR (NFCI).
Use common getCostForRecipeWithOpcode to get the cost for ICmp/FCmp.
1 parent 9ec771b commit d84be8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,12 +3045,13 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
30453045
case Instruction::AShr:
30463046
case Instruction::And:
30473047
case Instruction::Or:
3048-
case Instruction::Xor: {
3048+
case Instruction::Xor:
3049+
case Instruction::ICmp:
3050+
case Instruction::FCmp:
30493051
return *getCostForRecipeWithOpcode(getOpcode(), ElementCount::getFixed(1),
30503052
Ctx) *
30513053
(isSingleScalar() ? 1 : VF.getFixedValue());
30523054
}
3053-
}
30543055

30553056
return Ctx.getLegacyCost(UI, VF);
30563057
}

0 commit comments

Comments
 (0)