[llvm] [VPlan] Simplify Plan's entry in removeBranchOnConst. (PR #154510)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 31 14:48:08 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) {
----------------
ayalz wrote:
else, if the scalar loop is unreachable, this disconnection is redundant, as all edges associated with the loop will be disconnected, including this one from PH to header?
https://github.com/llvm/llvm-project/pull/154510
More information about the llvm-commits
mailing list