[llvm] [VPlan] Use BlockFrequencyInfo in getPredBlockCostDivisor (PR #158690)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 05:59:49 PST 2025


================
@@ -10265,9 +10272,7 @@ PreservedAnalyses LoopVectorizePass::run(Function &F,
 
   auto &MAMProxy = AM.getResult<ModuleAnalysisManagerFunctionProxy>(F);
   PSI = MAMProxy.getCachedResult<ProfileSummaryAnalysis>(*F.getParent());
-  BFI = nullptr;
-  if (PSI && PSI->hasProfileSummary())
-    BFI = &AM.getResult<BlockFrequencyAnalysis>(F);
+  BFI = &AM.getResult<BlockFrequencyAnalysis>(F);
----------------
lukel97 wrote:

I've made BFI be lazily computed in f2b5fce096c35271ddc47f70230e0435f3569d24, so we don't compute it until we encounter a predicated block that we need to calculate the cost discount for. This fixes the compile time regression, so the geomean is now +0.02% on stage1-O3: https://llvm-compile-time-tracker.com/compare.php?from=f15b756b56d0653181f062901916806bc5eba280&to=c56867b4480cac8de457c566805e969da0260c68&stat=instructions%3Au

https://github.com/llvm/llvm-project/pull/158690


More information about the llvm-commits mailing list