[llvm-branch-commits] [llvm] [VPlan] Fix VPInstruction::AnyOf combine undoing freeze (PR #223640)

Luke Lau via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 15 04:19:19 PDT 2026


================
@@ -3064,9 +3064,10 @@ getRecipesForUncountableExit(SmallVectorImpl<VPInstruction *> &Recipes,
 
   // Find the uncountable loop exit condition.
   VPValue *UncountableCondition = nullptr;
-  if (!match(LatchVPBB->getTerminator(),
-             m_BranchOnTwoConds(m_AnyOf(m_VPValue(UncountableCondition)),
-                                m_VPValue())))
+  if (!match(
+          LatchVPBB->getTerminator(),
+          m_BranchOnTwoConds(m_AnyOf(m_Freeze(m_VPValue(UncountableCondition))),
----------------
lukel97 wrote:

Yeah we might not necessarily need it to be conservatively correct I think we actually need to copy the freeze over, and not just peek through it. We should be using it not just for the VPInstruction::AnyOf, but also the VPInstruction::FirstActiveLane, I've added that to this PR in 3e7af90d2f8e899816bd25efa4488683a63ea958

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


More information about the llvm-branch-commits mailing list