[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


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

I had to move the code, becuase in order to preserve profile info on the vector loop when the remainder loop is dead requires retrieving the profile info before removing the remainder loop and conditionally setting the profile info on the vector/remainder loops as available.

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


More information about the llvm-commits mailing list