[llvm] [VPlan] Introduce child regions as VPlan transform. (PR #129402)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 02:20:46 PDT 2025


================
@@ -648,6 +648,22 @@ bool VPBasicBlock::isExiting() const {
   return getParent() && getParent()->getExitingBasicBlock() == this;
 }
 
+std::optional<std::pair<VPBasicBlock *, VPBasicBlock *>>
+VPBasicBlock::isHeader(const VPDominatorTree &VPDT) const {
+  ArrayRef<VPBlockBase *> Preds = getPredecessors();
+  if (Preds.size() != 2)
----------------
ayalz wrote:

This behavior corresponds to CFG-based VPlan, in contrast to the HCFG-based one (in VPlanHCFGBuilder.c below) where isHeader() is implemented by comparing the VPBB with it's parent's entry block.

https://github.com/llvm/llvm-project/pull/129402


More information about the llvm-commits mailing list