[llvm] [VPlan] Port invalid cost remarks to VPlan. (PR #99322)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 25 07:25:28 PDT 2024
================
@@ -4343,24 +4345,43 @@ bool LoopVectorizationPlanner::isMoreProfitable(
return CmpFn(RTCostA, RTCostB);
}
-static void emitInvalidCostRemarks(SmallVector<InstructionVFPair> InvalidCosts,
- OptimizationRemarkEmitter *ORE,
- Loop *TheLoop) {
+void LoopVectorizationPlanner::emitInvalidCostRemarks(
+ OptimizationRemarkEmitter *ORE) {
+ if (VPlans.empty())
+ return;
+
+ using RecipeVFPair = std::pair<VPRecipeBase *, ElementCount>;
+ SmallVector<RecipeVFPair> InvalidCosts;
+ for (const auto &Plan : VPlans) {
+ for (ElementCount VF : Plan->vectorFactors()) {
+ LLVMContext &LLVMCtx = OrigLoop->getHeader()->getContext();
+ VPCostContext CostCtx(CM.TTI, Legal->getWidestInductionType(), LLVMCtx,
+ CM);
----------------
ayalz wrote:
Can be defined at the outset?
https://github.com/llvm/llvm-project/pull/99322
More information about the llvm-commits
mailing list