[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


================
@@ -2565,6 +2565,9 @@ void InnerLoopVectorizer::fixVectorizedLoop(VPTransformState &State) {
   // Remove redundant induction instructions.
   cse(HeaderBB);
 
+  if (Plan.getScalarPreheader()->getNumPredecessors() == 0)
----------------
ayalz wrote:

Sounds like having `bool VPBlockBase::hasPredecessors()` could be useful; possibly implemented using empty().

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


More information about the llvm-commits mailing list