[PATCH] D74445: [VPlan] Add ParentPlan pointer to VPBlockBase.

Gil Rapaport via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 02:12:34 PST 2020


gilr accepted this revision.
gilr added a comment.
This revision is now accepted and ready to land.

LGTM, with minor fix.



================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:60
+// Get the top-most entry block of \p Start. This is the entry block of the
+// containing VPlan.
+template <typename T> static T *getPlanEntry(T *Start) {
----------------
nit: I'd add something like "Function is templated to support both const and non-const blocks" for clarity.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:68
+  Next = Current;
+  while ((Next = Next->getSinglePredecessor()))
+    Current = Next;
----------------
This would wrongfully return nullptr for multiple predecessors. Better use *getPredecessors().begin() after checking that there are any.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74445





More information about the llvm-commits mailing list