[llvm] [VPlan] Replace VPRegionBlock with explicit CFG before execute (NFCI). (PR #117506)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 04:36:53 PDT 2025


================
@@ -207,6 +207,11 @@ VPBlockBase *VPBlockBase::getEnclosingBlockWithPredecessors() {
   return Parent->getEnclosingBlockWithPredecessors();
 }
 
+bool VPBasicBlock::isHeader(const VPDominatorTree &VPDT) const {
+  return getPredecessors().size() == 2 &&
+         VPDT.dominates(this, getPredecessors()[1]);
+}
+
----------------
fhahn wrote:

Region headers for the top region will always have canonical phis, but the header block of the inner loop when doing outer-loop vectorization would not have one.

I moved it to VPBlockUtils for now.

Not sure if it is worth adding the extra abstractions, just to make it slightly easier to identify header blocks independent of the CFG? Would there be other benefits?

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


More information about the llvm-commits mailing list