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

via llvm-commits llvm-commits at lists.llvm.org
Sun May 11 05:02:07 PDT 2025


================
@@ -437,14 +441,18 @@ void VPBasicBlock::connectToPredecessors(VPTransformState &State) {
   for (VPBlockBase *PredVPBlock : getHierarchicalPredecessors()) {
     VPBasicBlock *PredVPBB = PredVPBlock->getExitingBasicBlock();
     auto &PredVPSuccessors = PredVPBB->getHierarchicalSuccessors();
-    BasicBlock *PredBB = CFG.VPBB2IRBB[PredVPBB];
+    BasicBlock *PredBB = CFG.VPBB2IRBB.lookup(PredVPBB);
+    if (!PredBB)
+      continue;
----------------
ayalz wrote:

nit: early-continue asap
```suggestion
    BasicBlock *PredBB = CFG.VPBB2IRBB.lookup(PredVPBB);
    // Explain when PredBB may be absent?
    if (!PredBB)
      continue;
    auto &PredVPSuccessors = PredVPBB->getHierarchicalSuccessors();
```

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


More information about the llvm-commits mailing list