[llvm] cc97a0d - [LV] Use getBestPlan when interleaving only. (NFCI)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 04:01:10 PDT 2024


Author: Florian Hahn
Date: 2024-07-16T12:00:49+01:00
New Revision: cc97a0d34787e4c9151fa894531ad9d07486a6ae

URL: https://github.com/llvm/llvm-project/commit/cc97a0d34787e4c9151fa894531ad9d07486a6ae
DIFF: https://github.com/llvm/llvm-project/commit/cc97a0d34787e4c9151fa894531ad9d07486a6ae.diff

LOG: [LV] Use getBestPlan when interleaving only. (NFCI)

Use the getBestPlan() utility added in b841e2eca3 to also get the
scalar plan when interleaving only.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 4eb88fe32a820..38c1fc705f9ff 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -10281,7 +10281,9 @@ bool LoopVectorizePass::processLoop(Loop *L) {
       InnerLoopUnroller Unroller(L, PSE, LI, DT, TLI, TTI, AC, ORE, IC, &LVL,
                                  &CM, BFI, PSI, Checks);
 
-      VPlan &BestPlan = LVP.getBestPlanFor(VF.Width);
+      VPlan &BestPlan = LVP.getBestPlan();
+      assert(BestPlan.hasScalarVFOnly() &&
+             "VPlan cost model and legacy cost model disagreed");
       LVP.executePlan(VF.Width, IC, BestPlan, Unroller, DT, false);
 
       ORE->emit([&]() {


        


More information about the llvm-commits mailing list