[llvm] [VPlan] Simplify Plan's entry in removeBranchOnConst. (PR #154510)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 1 05:54:15 PDT 2025
================
@@ -972,12 +972,14 @@ void VPlan::execute(VPTransformState *State) {
setName("Final VPlan");
LLVM_DEBUG(dump());
- // Disconnect scalar preheader and scalar header, as the dominator tree edge
- // will be updated as part of VPlan execution. This allows keeping the DTU
- // logic generic during VPlan execution.
BasicBlock *ScalarPh = State->CFG.ExitBB;
- State->CFG.DTU.applyUpdates(
- {{DominatorTree::Delete, ScalarPh, ScalarPh->getSingleSuccessor()}});
+ if (getScalarPreheader()->getNumPredecessors() > 0) {
----------------
fhahn wrote:
The issue is that the updater than would try to apply an update to a disconnected part of the CFG, which will result in a crash, as the edge we are trying to update won't exist.
https://github.com/llvm/llvm-project/pull/154510
More information about the llvm-commits
mailing list