[PATCH] D111125: [NFC][LoopVectorize] Remove setBestPlan in favour of getBestPlanFor

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 09:07:54 PDT 2021


sdesmalen added a comment.

(Sorry for the slow reply, I was traveling last week)

My suggestion on the other patch was to make the code structurally simpler. Removing plans prematurely complicates things, because you need to carefully keep track which plans can be removed and which ones may be needed.
@bmahjour Is there a real problem with memory-usage that requires us to reduce the lifetime of these plans a little bit longer? If not, I'd like to suggest not removing the plans to keep the code simpler.



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8208
   // 1. Create a new empty loop. Unlink the old loop and connect the new one.
-  assert(BestVF.hasValue() && "Vectorization Factor is missing");
-  assert(VPlans.size() == 1 && "Not a single VPlan to execute.");
-
-  VPTransformState State{
-      *BestVF, BestUF, LI, DT, ILV.Builder, &ILV, VPlans.front().get()};
+  VPTransformState State{BestVF, BestUF,         LI, DT, ILV.Builder,
+                         &ILV,   BestVPlan.get()};
----------------
nit: odd spaces?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111125/new/

https://reviews.llvm.org/D111125



More information about the llvm-commits mailing list