[PATCH] D74445: [VPlan] Add ParentPlan pointer to VPBlockBase.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 3 03:04:17 PST 2020
fhahn marked 2 inline comments as done.
fhahn added inline comments.
================
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) {
----------------
gilr wrote:
> nit: I'd add something like "Function is templated to support both const and non-const blocks" for clarity.
Will do before committing.
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:68
+ Next = Current;
+ while ((Next = Next->getSinglePredecessor()))
+ Current = Next;
----------------
gilr wrote:
> This would wrongfully return nullptr for multiple predecessors. Better use *getPredecessors().begin() after checking that there are any.
Agreed! I think currently we do not really generate such CFGs on the top-level, due to the nesting with region blocks, but I'll generalize it to explore all predecessors until we reach one without any predecessors.
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