[PATCH] D100260: [VPlan] Merge predicated-triangle regions, after sinking.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 02:26:24 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:204
+    auto *MiddleBasicBlock =
+        dyn_cast<VPBasicBlock>(Region1->getSingleSuccessor());
+    if (!MiddleBasicBlock || !MiddleBasicBlock->empty())
----------------
Ayal wrote:
> could use `dyn_cast_or_null<VPBasicBlock>(Region1->getSingleSuccessor());` here instead of filtering regions with non single successors earlier (which probably do not exist).
I kept the code as it is for now, because collecting the candidates up-front is required to avoid iterator invalidation problems caused by removing a region and adjusting predecessors/successors.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100260



More information about the llvm-commits mailing list