[llvm] d84be8a - [VPlan] Get Cmp cost via getCostForRecipeWithOp for VPReplicateR (NFCI).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 24 11:45:33 PDT 2025
Author: Florian Hahn
Date: 2025-08-24T19:43:22+01:00
New Revision: d84be8a9b400609f29713fc3e07f98c0b8df622c
URL: https://github.com/llvm/llvm-project/commit/d84be8a9b400609f29713fc3e07f98c0b8df622c
DIFF: https://github.com/llvm/llvm-project/commit/d84be8a9b400609f29713fc3e07f98c0b8df622c.diff
LOG: [VPlan] Get Cmp cost via getCostForRecipeWithOp for VPReplicateR (NFCI).
Use common getCostForRecipeWithOpcode to get the cost for ICmp/FCmp.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index c4fdcccc6d62b..0368f9b8dbb00 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -3045,12 +3045,13 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
case Instruction::AShr:
case Instruction::And:
case Instruction::Or:
- case Instruction::Xor: {
+ case Instruction::Xor:
+ case Instruction::ICmp:
+ case Instruction::FCmp:
return *getCostForRecipeWithOpcode(getOpcode(), ElementCount::getFixed(1),
Ctx) *
(isSingleScalar() ? 1 : VF.getFixedValue());
}
- }
return Ctx.getLegacyCost(UI, VF);
}
More information about the llvm-commits
mailing list