Skip to content

Conversation

@lukel97
Copy link
Contributor

@lukel97 lukel97 commented Jan 27, 2026

This is split out from #177114.

In order to make canonicalizeEVLLoops a generic "convert to variable stepping" transform, move the code that changes the exit condition to a separate transform since not all variable stepping loops will want to transform the exit condition. Run it before canonicalizeEVLLoops before VPEVLBasedIVPHIRecipe is expanded.

Also relax the assertion for VPInstruction::ExplicitVectorLength to just bail instead, since eventually VPEVLBasedIVPHIRecipe will be used by other loops that aren't EVL tail folded.

This is split out from llvm#177114.

In order to make canonicalizeEVLLoops a generic "convert to variable stepping" transform, move the code that changes the exit condition to a separate transform. Run it before canonicalizeEVLLoops before VPEVLBasedIVPHIRecipe is expanded.

Also relax the assertion for VPInstruction::ExplicitVectorLength to just bail instead, since eventually VPEVLBasedIVPHIRecipe will be used by other loops that aren't EVL tail folded.
@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2026

@llvm/pr-subscribers-llvm-transforms

Author: Luke Lau (lukel97)

Changes

This is split out from #177114.

In order to make canonicalizeEVLLoops a generic "convert to variable stepping" transform, move the code that changes the exit condition to a separate transform. Run it before canonicalizeEVLLoops before VPEVLBasedIVPHIRecipe is expanded.

Also relax the assertion for VPInstruction::ExplicitVectorLength to just bail instead, since eventually VPEVLBasedIVPHIRecipe will be used by other loops that aren't EVL tail folded.


Full diff: https://github.com/llvm/llvm-project/pull/178181.diff

3 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+2)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp (+40-27)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.h (+6-4)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 3cf5e5fb3f818..6f0c59bc8f0ea 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7430,6 +7430,8 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   // Expand BranchOnTwoConds after dissolution, when latch has direct access to
   // its successors.
   VPlanTransforms::expandBranchOnTwoConds(BestVPlan);
+  // Switch the exit condition to AVLNext == 0 for EVL tail folded loops.
+  VPlanTransforms::convertEVLExitCond(BestVPlan);
   // Canonicalize EVL loops after regions are dissolved.
   VPlanTransforms::canonicalizeEVLLoops(BestVPlan);
   VPlanTransforms::materializeBackedgeTakenCount(BestVPlan, VectorPH);
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index d1d5870d78a03..52dd74baef6ec 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -3247,9 +3247,9 @@ void VPlanTransforms::addExplicitVectorLength(
   Plan.setUF(1);
 }
 
-void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
-  // Find EVL loop entries by locating VPEVLBasedIVPHIRecipe.
-  // There should be only one EVL PHI in the entire plan.
+/// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe.
+/// There should be only one EVL PHI in the entire plan.
+static VPEVLBasedIVPHIRecipe *findEVLPhi(VPlan &Plan) {
   VPEVLBasedIVPHIRecipe *EVLPhi = nullptr;
 
   for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
@@ -3260,28 +3260,17 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
         EVLPhi = PhiR;
       }
 
+  return EVLPhi;
+}
+
+void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
+  VPEVLBasedIVPHIRecipe *EVLPhi = findEVLPhi(Plan);
   // Early return if no EVL PHI is found.
   if (!EVLPhi)
     return;
 
   VPBasicBlock *HeaderVPBB = EVLPhi->getParent();
   VPValue *EVLIncrement = EVLPhi->getBackedgeValue();
-  VPValue *AVL;
-  [[maybe_unused]] bool FoundAVL =
-      match(EVLIncrement,
-            m_c_Add(m_ZExtOrSelf(m_EVL(m_VPValue(AVL))), m_Specific(EVLPhi)));
-  assert(FoundAVL && "Didn't find AVL?");
-
-  // The AVL may be capped to a safe distance.
-  VPValue *SafeAVL;
-  if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
-    AVL = SafeAVL;
-
-  VPValue *AVLNext;
-  [[maybe_unused]] bool FoundAVLNext =
-      match(AVL, m_VPInstruction<Instruction::PHI>(
-                     m_Specific(Plan.getTripCount()), m_VPValue(AVLNext)));
-  assert(FoundAVLNext && "Didn't find AVL backedge?");
 
   // Convert EVLPhi to concrete recipe.
   auto *ScalarR =
@@ -3302,21 +3291,45 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
   VPRecipeBase *CanonicalIVIncrement = Backedge->getDefiningRecipe();
   CanonicalIVIncrement->eraseFromParent();
   CanonicalIV->eraseFromParent();
+}
 
-  // Replace the use of VectorTripCount in the latch-exiting block.
-  // Before: (branch-on-cond (icmp eq EVLIVInc, VectorTripCount))
-  // After: (branch-on-cond icmp eq AVLNext, 0)
+void VPlanTransforms::convertEVLExitCond(VPlan &Plan) {
+  VPEVLBasedIVPHIRecipe *EVLPhi = findEVLPhi(Plan);
+  if (!EVLPhi)
+    return;
+
+  // Bail if not an EVL tail folded loop.
+  VPValue *AVL;
+  if (!match(EVLPhi->getBackedgeValue(),
+             m_c_Add(m_ZExtOrSelf(m_EVL(m_VPValue(AVL))), m_Specific(EVLPhi))))
+    return;
+
+  // The AVL may be capped to a safe distance.
+  VPValue *SafeAVL;
+  if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
+    AVL = SafeAVL;
+
+  VPValue *AVLNext;
+  [[maybe_unused]] bool FoundAVLNext =
+      match(AVL, m_VPInstruction<Instruction::PHI>(
+                     m_Specific(Plan.getTripCount()), m_VPValue(AVLNext)));
+  assert(FoundAVLNext && "Didn't find AVL backedge?");
+
+  VPBasicBlock *HeaderVPBB = EVLPhi->getParent();
   VPBasicBlock *LatchExiting =
       HeaderVPBB->getPredecessors()[1]->getEntryBasicBlock();
   auto *LatchExitingBr = cast<VPInstruction>(LatchExiting->getTerminator());
   if (match(LatchExitingBr, m_BranchOnCond(m_True())))
     return;
 
-  assert(match(LatchExitingBr, m_BranchOnCond(m_SpecificCmp(
-                                   CmpInst::ICMP_EQ, m_VPValue(EVLIncrement),
-                                   m_Specific(&Plan.getVectorTripCount())))) &&
-         "Expected BranchOnCond with ICmp comparing EVL increment with vector "
-         "trip count");
+  [[maybe_unused]] auto *CanIV = cast<VPPhi>(&*EVLPhi->getParent()->begin());
+  assert(
+      match(LatchExitingBr,
+            m_BranchOnCond(m_SpecificCmp(
+                CmpInst::ICMP_EQ, m_Specific(CanIV->getIncomingValue(1)),
+                m_Specific(&Plan.getVectorTripCount())))) &&
+      "Expected BranchOnCond with ICmp comparing CanIV increment with vector "
+      "trip count");
 
   Type *AVLTy = VPTypeAnalysis(Plan).inferScalarType(AVLNext);
   VPBuilder Builder(LatchExitingBr);
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
index e0d09a099647a..16db95df15da6 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
@@ -315,12 +315,14 @@ struct VPlanTransforms {
   /// variable vector lengths instead of fixed lengths. This transformation:
   ///  * Makes EVL-Phi concrete.
   //   * Removes CanonicalIV and increment.
-  ///  * Replaces the exit condition from
-  ///      (branch-on-count CanonicalIVInc, VectorTripCount)
-  ///    to
-  ///      (branch-on-cond eq AVLNext, 0)
   static void canonicalizeEVLLoops(VPlan &Plan);
 
+  /// Replaces the exit condition from
+  ///   (branch-on-count CanonicalIVInc, VectorTripCount)
+  /// to
+  ///   (branch-on-cond eq AVLNext, 0)
+  static void convertEVLExitCond(VPlan &Plan);
+
   /// Lower abstract recipes to concrete ones, that can be codegen'd.
   static void convertToConcreteRecipes(VPlan &Plan);
 

@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2026

@llvm/pr-subscribers-vectorizers

Author: Luke Lau (lukel97)

Changes

This is split out from #177114.

In order to make canonicalizeEVLLoops a generic "convert to variable stepping" transform, move the code that changes the exit condition to a separate transform. Run it before canonicalizeEVLLoops before VPEVLBasedIVPHIRecipe is expanded.

Also relax the assertion for VPInstruction::ExplicitVectorLength to just bail instead, since eventually VPEVLBasedIVPHIRecipe will be used by other loops that aren't EVL tail folded.


Full diff: https://github.com/llvm/llvm-project/pull/178181.diff

3 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+2)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp (+40-27)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.h (+6-4)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 3cf5e5fb3f818..6f0c59bc8f0ea 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7430,6 +7430,8 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   // Expand BranchOnTwoConds after dissolution, when latch has direct access to
   // its successors.
   VPlanTransforms::expandBranchOnTwoConds(BestVPlan);
+  // Switch the exit condition to AVLNext == 0 for EVL tail folded loops.
+  VPlanTransforms::convertEVLExitCond(BestVPlan);
   // Canonicalize EVL loops after regions are dissolved.
   VPlanTransforms::canonicalizeEVLLoops(BestVPlan);
   VPlanTransforms::materializeBackedgeTakenCount(BestVPlan, VectorPH);
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index d1d5870d78a03..52dd74baef6ec 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -3247,9 +3247,9 @@ void VPlanTransforms::addExplicitVectorLength(
   Plan.setUF(1);
 }
 
-void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
-  // Find EVL loop entries by locating VPEVLBasedIVPHIRecipe.
-  // There should be only one EVL PHI in the entire plan.
+/// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe.
+/// There should be only one EVL PHI in the entire plan.
+static VPEVLBasedIVPHIRecipe *findEVLPhi(VPlan &Plan) {
   VPEVLBasedIVPHIRecipe *EVLPhi = nullptr;
 
   for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
@@ -3260,28 +3260,17 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
         EVLPhi = PhiR;
       }
 
+  return EVLPhi;
+}
+
+void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
+  VPEVLBasedIVPHIRecipe *EVLPhi = findEVLPhi(Plan);
   // Early return if no EVL PHI is found.
   if (!EVLPhi)
     return;
 
   VPBasicBlock *HeaderVPBB = EVLPhi->getParent();
   VPValue *EVLIncrement = EVLPhi->getBackedgeValue();
-  VPValue *AVL;
-  [[maybe_unused]] bool FoundAVL =
-      match(EVLIncrement,
-            m_c_Add(m_ZExtOrSelf(m_EVL(m_VPValue(AVL))), m_Specific(EVLPhi)));
-  assert(FoundAVL && "Didn't find AVL?");
-
-  // The AVL may be capped to a safe distance.
-  VPValue *SafeAVL;
-  if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
-    AVL = SafeAVL;
-
-  VPValue *AVLNext;
-  [[maybe_unused]] bool FoundAVLNext =
-      match(AVL, m_VPInstruction<Instruction::PHI>(
-                     m_Specific(Plan.getTripCount()), m_VPValue(AVLNext)));
-  assert(FoundAVLNext && "Didn't find AVL backedge?");
 
   // Convert EVLPhi to concrete recipe.
   auto *ScalarR =
@@ -3302,21 +3291,45 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
   VPRecipeBase *CanonicalIVIncrement = Backedge->getDefiningRecipe();
   CanonicalIVIncrement->eraseFromParent();
   CanonicalIV->eraseFromParent();
+}
 
-  // Replace the use of VectorTripCount in the latch-exiting block.
-  // Before: (branch-on-cond (icmp eq EVLIVInc, VectorTripCount))
-  // After: (branch-on-cond icmp eq AVLNext, 0)
+void VPlanTransforms::convertEVLExitCond(VPlan &Plan) {
+  VPEVLBasedIVPHIRecipe *EVLPhi = findEVLPhi(Plan);
+  if (!EVLPhi)
+    return;
+
+  // Bail if not an EVL tail folded loop.
+  VPValue *AVL;
+  if (!match(EVLPhi->getBackedgeValue(),
+             m_c_Add(m_ZExtOrSelf(m_EVL(m_VPValue(AVL))), m_Specific(EVLPhi))))
+    return;
+
+  // The AVL may be capped to a safe distance.
+  VPValue *SafeAVL;
+  if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
+    AVL = SafeAVL;
+
+  VPValue *AVLNext;
+  [[maybe_unused]] bool FoundAVLNext =
+      match(AVL, m_VPInstruction<Instruction::PHI>(
+                     m_Specific(Plan.getTripCount()), m_VPValue(AVLNext)));
+  assert(FoundAVLNext && "Didn't find AVL backedge?");
+
+  VPBasicBlock *HeaderVPBB = EVLPhi->getParent();
   VPBasicBlock *LatchExiting =
       HeaderVPBB->getPredecessors()[1]->getEntryBasicBlock();
   auto *LatchExitingBr = cast<VPInstruction>(LatchExiting->getTerminator());
   if (match(LatchExitingBr, m_BranchOnCond(m_True())))
     return;
 
-  assert(match(LatchExitingBr, m_BranchOnCond(m_SpecificCmp(
-                                   CmpInst::ICMP_EQ, m_VPValue(EVLIncrement),
-                                   m_Specific(&Plan.getVectorTripCount())))) &&
-         "Expected BranchOnCond with ICmp comparing EVL increment with vector "
-         "trip count");
+  [[maybe_unused]] auto *CanIV = cast<VPPhi>(&*EVLPhi->getParent()->begin());
+  assert(
+      match(LatchExitingBr,
+            m_BranchOnCond(m_SpecificCmp(
+                CmpInst::ICMP_EQ, m_Specific(CanIV->getIncomingValue(1)),
+                m_Specific(&Plan.getVectorTripCount())))) &&
+      "Expected BranchOnCond with ICmp comparing CanIV increment with vector "
+      "trip count");
 
   Type *AVLTy = VPTypeAnalysis(Plan).inferScalarType(AVLNext);
   VPBuilder Builder(LatchExitingBr);
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
index e0d09a099647a..16db95df15da6 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
@@ -315,12 +315,14 @@ struct VPlanTransforms {
   /// variable vector lengths instead of fixed lengths. This transformation:
   ///  * Makes EVL-Phi concrete.
   //   * Removes CanonicalIV and increment.
-  ///  * Replaces the exit condition from
-  ///      (branch-on-count CanonicalIVInc, VectorTripCount)
-  ///    to
-  ///      (branch-on-cond eq AVLNext, 0)
   static void canonicalizeEVLLoops(VPlan &Plan);
 
+  /// Replaces the exit condition from
+  ///   (branch-on-count CanonicalIVInc, VectorTripCount)
+  /// to
+  ///   (branch-on-cond eq AVLNext, 0)
+  static void convertEVLExitCond(VPlan &Plan);
+
   /// Lower abstract recipes to concrete ones, that can be codegen'd.
   static void convertToConcreteRecipes(VPlan &Plan);
 

@lukel97
Copy link
Contributor Author

lukel97 commented Jan 27, 2026

cc @eas

return;

assert(match(LatchExitingBr, m_BranchOnCond(m_SpecificCmp(
CmpInst::ICMP_EQ, m_VPValue(EVLIncrement),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also fixes this m_VPValue, it should be a m_Specific

// Expand BranchOnTwoConds after dissolution, when latch has direct access to
// its successors.
VPlanTransforms::expandBranchOnTwoConds(BestVPlan);
// Switch the exit condition to AVLNext == 0 for EVL tail folded loops.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: transform/convert may be more in line with owrding elswhere

Suggested change
// Switch the exit condition to AVLNext == 0 for EVL tail folded loops.
// Convert the exit condition to AVLNext == 0 for EVL tail folded loops.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks

Comment on lines 3250 to 3251
/// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe.
/// There should be only one EVL PHI in the entire plan.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to note that now we need to traverse the full VPlan twice if there's no EVL recipe.

would be good if there would a good way to exit early one we can't find a EVL recipe in the header if possible. There's getFirstLoopHeader which works on plain CFG but would require VPDT, which is likely not worth it unless already available.

I think later we assert that the first phi in EVL's parent is a canonical IV, via below. Maybe we could try to check this early, and bail out once we found a block with a canonical IV-like but not a VPEVLBasedIVPHIRecipe recipes. Not sure if we may be able to check if the increment of the phi is used by the expected branch-on-cond.

 [[maybe_unused]] auto *CanIV = cast<VPPhi>(&*EVLPhi->getParent()->begin());
  assert(
      match(LatchExitingBr,
            m_BranchOnCond(m_SpecificCmp(
                CmpInst::ICMP_EQ, m_Specific(CanIV->getIncomingValue(1)),
                m_Specific(&Plan.getVectorTripCount())))) &&

Copy link
Contributor Author

@lukel97 lukel97 Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you mention it, we can just do the branch condition transform before the loop regions are dissolved and use getCanonicalIV, the EVL IV will immediately follow it if it exists 0a49ca0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving makes sense, thanks

Comment on lines 320 to 324
/// Replaces the exit condition from
/// (branch-on-count CanonicalIVInc, VectorTripCount)
/// to
/// (branch-on-cond eq AVLNext, 0)
static void convertEVLExitCond(VPlan &Plan);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there's no clear order to definitions, but convertEVLExitCond runs before canonicalizeEVLLoops, so might be worth moving first?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks

* Move to before loop regions are dissolved so we can access the canonical IV easier.
* Fix comment
* Reorder definition
return;
// The EVL IV is always immediately after the canonical IV.
auto *EVLPhi =
dyn_cast_or_null<VPEVLBasedIVPHIRecipe>(std::next(CanIV->getIterator()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we enforce the order in the verifier, so relying on it may miss some cases in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we already verified this but apparently not, added in f8952aa. Maybe I had seen an assert for it somewhere else.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to check how we retrieve EVL phi in other palces, possibly shairng the logic in a helper, possibly as follow-up.

Comment on lines 3250 to 3251
/// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe.
/// There should be only one EVL PHI in the entire plan.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving makes sense, thanks


// The AVL may be capped to a safe distance.
VPValue *SafeAVL;
if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to the patch itself, but it might be good to think if we can match something more precise here, in case some transform gets applied to the original select

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can make this more explicit. Will try to do in a follow up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks!

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

return false;
}
}
if (const auto *EVLIV = dyn_cast<VPEVLBasedIVPHIRecipe>(&R)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better move to verifyPhiRecipes?

return;
// The EVL IV is always immediately after the canonical IV.
auto *EVLPhi =
dyn_cast_or_null<VPEVLBasedIVPHIRecipe>(std::next(CanIV->getIterator()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to check how we retrieve EVL phi in other palces, possibly shairng the logic in a helper, possibly as follow-up.

Comment on lines 343 to 344
if (!isa_and_nonnull<VPCanonicalIVPHIRecipe>(
std::prev(EVLIV->getIterator()))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a note to myself: this should be fine, because we already verify that the canonical IV is at the beginning of the block, so the EVL based phi cannot be the first element, in which acse std::prev would be UB.

VPBasicBlock *LatchVPBB);

/// Replaces the exit condition from
/// (branch-on-count CanonicalIVInc, VectorTripCount)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs updating I think , we are converting branch-on-cond to use a different condition


// The AVL may be capped to a safe distance.
VPValue *SafeAVL;
if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thanks!

!isa<VPCanonicalIVPHIRecipe>(LoopRegion->getEntryBasicBlock()->front()))
return;
VPCanonicalIVPHIRecipe *CanIV = LoopRegion->getCanonicalIV();
if (!CanIV || std::next(CanIV->getIterator()) == CanIV->getParent()->end())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!CanIV || std::next(CanIV->getIterator()) == CanIV->getParent()->end())
if (std::next(CanIV->getIterator()) == CanIV->getParent()->end())

After the check above, CanIV should always be != null

@lukel97 lukel97 enabled auto-merge (squash) February 2, 2026 04:04
@lukel97 lukel97 merged commit bb14eab into llvm:main Feb 2, 2026
9 of 10 checks passed
lukel97 added a commit to lukel97/llvm-project that referenced this pull request Feb 2, 2026
@llvm-ci
Copy link

llvm-ci commented Feb 2, 2026

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-fast running on sanitizer-buildbot4 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/19529

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 95796 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 
FAIL: LLVM :: ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll (29920 of 95796)
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll    /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# note: command had no output on stdout or stderr
# RUN: at line 8
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout    -jd extra -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll -jd main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -jd extra -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll -jd main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll
# .---command stderr------------
# | JIT session error: In graph /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll.submodule.0xc6f8578fcbdce37e.ll-jitted-objectbuffer, section .text: relocation target 0x7462ce03902c (__orc_lcl.str3.3:0x7462ce039030 + 0xfffffffffffffffc) is out of range of Delta32 fixup at address 0x7462ce039030 (printf_wrapper, 0x7062cd06a000 + 0x3)
# | JIT session error: Failed to materialize symbols: { (extra.impl, { printf_wrapper }) }
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# .---command stderr------------
# | /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll:16:10: error: CHECK: expected string not found in input
# | ; CHECK: Goodbye from destructor
# |          ^
# | <stdin>:14:26: note: scanning from here
# | Goodbye from __cxa_atexit
# |                          ^
# | <stdin>:15:3: note: possible intended match here
# | [ printf_wrapper ]
# |   ^
# | 
# | Input file: <stdin>
# | Check file: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
Step 10 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:561: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 95796 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 
FAIL: LLVM :: ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll (29920 of 95796)
******************** TEST 'LLVM :: ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll    /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll
# note: command had no output on stdout or stderr
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# note: command had no output on stdout or stderr
# RUN: at line 8
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout    -jd extra -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll -jd main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout -jd extra -extra-module /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll -jd main /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/Inputs/noop-main.ll
# .---command stderr------------
# | JIT session error: In graph /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll.submodule.0xc6f8578fcbdce37e.ll-jitted-objectbuffer, section .text: relocation target 0x7462ce03902c (__orc_lcl.str3.3:0x7462ce039030 + 0xfffffffffffffffc) is out of range of Delta32 fixup at address 0x7462ce039030 (printf_wrapper, 0x7062cd06a000 + 0x3)
# | JIT session error: Failed to materialize symbols: { (extra.impl, { printf_wrapper }) }
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# .---command stderr------------
# | /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll:16:10: error: CHECK: expected string not found in input
# | ; CHECK: Goodbye from destructor
# |          ^
# | <stdin>:14:26: note: scanning from here
# | Goodbye from __cxa_atexit
# |                          ^
# | <stdin>:15:3: note: possible intended match here
# | [ printf_wrapper ]
# |   ^
# | 
# | Input file: <stdin>
# | Check file: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<

@llvm-ci
Copy link

llvm-ci commented Feb 2, 2026

LLVM Buildbot has detected a new failure on builder sanitizer-ppc64le-linux running on ppc64le-sanitizer while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/72/builds/17128

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure) (timed out)
...
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/variadic-open.cpp (1265 of 2880)
PASS: Profile-powerpc64le :: instrprof-get-filename.c (1266 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/regex_startend.cpp (1267 of 2880)
PASS: Profile-powerpc64le :: ContinuousSyncMode/basic.c (1268 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/create_thread_loop2.cpp (1269 of 2880)
PASS: Profile-powerpc64le :: instrprof-set-filename-then-reset-default.c (1270 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/free_aligned_sized.c (1271 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: get_allocated_begin.cpp (1272 of 2880)
PASS: Profile-powerpc64le :: instrprof-merge-entry-cover.c (1273 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: malloc_hook_get_allocated_size_fast.cpp (1274 of 2880)
FAIL: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/getpwnam_r_invalid_user.cpp (1275 of 2880)
******************** TEST 'SanitizerCommon-lsan-powerpc64le-Linux :: Linux/getpwnam_r_invalid_user.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 2
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=leak  -m64 -fno-function-sections -funwind-tables  -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test -ldl -O0 -g /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp &&  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=leak -m64 -fno-function-sections -funwind-tables -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test -ldl -O0 -g /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
# .---command stderr------------
# | Result: 110
# | getpwnam_r_invalid_user.cpp.tmp: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp:19: int main(): Assertion `res == 0 || res == ENOENT' failed.
# `-----------------------------
# error: command failed with exit status: -6

--

********************
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: fopen_nullptr.c (1276 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: sanitizer_coverage_inline_bool_flag.cpp (1277 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: dlsym_alloc.c (1278 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/protoent.cpp (1279 of 2880)
PASS: MemorySanitizer-POWERPC64LE :: dladdr1_test.c (1280 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: print-stack-trace-markup.cpp (1281 of 2880)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: vsnprintf.cpp (1282 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/realpath.cpp (1283 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: printf-ldbl.c (1284 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/clock_gettime.c (1285 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/abort_on_error.cpp (1286 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/fputs_puts_null.cpp (1287 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: sanitizer_coverage_inline8bit_counter.cpp (1288 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/malloc_zone.cpp (1289 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/print-stack-trace-in-code-loaded-after-fork.cpp (1290 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/print-stack-trace.cpp (1291 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/symbolizer-function-offset-atos.cpp (1292 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/symbolizer-function-offset-dladdr.cpp (1293 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/freadlink.c (1294 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: FreeBSD/dump_registers_i386.cpp (1295 of 2880)
Step 9 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/variadic-open.cpp (1265 of 2880)
PASS: Profile-powerpc64le :: instrprof-get-filename.c (1266 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/regex_startend.cpp (1267 of 2880)
PASS: Profile-powerpc64le :: ContinuousSyncMode/basic.c (1268 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/create_thread_loop2.cpp (1269 of 2880)
PASS: Profile-powerpc64le :: instrprof-set-filename-then-reset-default.c (1270 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/free_aligned_sized.c (1271 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: get_allocated_begin.cpp (1272 of 2880)
PASS: Profile-powerpc64le :: instrprof-merge-entry-cover.c (1273 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: malloc_hook_get_allocated_size_fast.cpp (1274 of 2880)
FAIL: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/getpwnam_r_invalid_user.cpp (1275 of 2880)
******************** TEST 'SanitizerCommon-lsan-powerpc64le-Linux :: Linux/getpwnam_r_invalid_user.cpp' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 2
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang  --driver-mode=g++ -gline-tables-only -fsanitize=leak  -m64 -fno-function-sections -funwind-tables  -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test -ldl -O0 -g /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp &&  /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/./bin/clang --driver-mode=g++ -gline-tables-only -fsanitize=leak -m64 -fno-function-sections -funwind-tables -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test -ldl -O0 -g /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/runtimes/runtimes-bins/compiler-rt/test/sanitizer_common/lsan-powerpc64le-Linux/Linux/Output/getpwnam_r_invalid_user.cpp.tmp
# .---command stderr------------
# | Result: 110
# | getpwnam_r_invalid_user.cpp.tmp: /home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cpp:19: int main(): Assertion `res == 0 || res == ENOENT' failed.
# `-----------------------------
# error: command failed with exit status: -6

--

********************
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: fopen_nullptr.c (1276 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: sanitizer_coverage_inline_bool_flag.cpp (1277 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: dlsym_alloc.c (1278 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/protoent.cpp (1279 of 2880)
PASS: MemorySanitizer-POWERPC64LE :: dladdr1_test.c (1280 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: print-stack-trace-markup.cpp (1281 of 2880)
UNSUPPORTED: SanitizerCommon-lsan-powerpc64le-Linux :: vsnprintf.cpp (1282 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Posix/realpath.cpp (1283 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: printf-ldbl.c (1284 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: Linux/clock_gettime.c (1285 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/abort_on_error.cpp (1286 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/fputs_puts_null.cpp (1287 of 2880)
PASS: SanitizerCommon-lsan-powerpc64le-Linux :: sanitizer_coverage_inline8bit_counter.cpp (1288 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/malloc_zone.cpp (1289 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/print-stack-trace-in-code-loaded-after-fork.cpp (1290 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/print-stack-trace.cpp (1291 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/symbolizer-function-offset-atos.cpp (1292 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/symbolizer-function-offset-dladdr.cpp (1293 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: Darwin/freadlink.c (1294 of 2880)
UNSUPPORTED: SanitizerCommon-msan-powerpc64le-Linux :: FreeBSD/dump_registers_i386.cpp (1295 of 2880)

@llvm-ci
Copy link

llvm-ci commented Feb 2, 2026

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-test-suite running on ppc64le-clang-test-suite while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/19938

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LeakSanitizer-Standalone-powerpc64le :: TestCases/create_thread_leak.cpp' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 3
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang  --driver-mode=g++ -O0  -m64 -fno-function-sections  -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang --driver-mode=g++ -O0 -m64 -fno-function-sections -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
# RUN: at line 4
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
# RUN: at line 5
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# RUN: at line 6
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# `-----------------------------
# error: command failed with exit status: 2

--

********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants