[llvm] [VPlan] Fix `pseudoprobe` being treated a vector intrinsic (PR #185347)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 9 06:15:31 PDT 2026
================
@@ -92,7 +92,13 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
Ingredient.getDebugLoc());
} else if (CallInst *CI = dyn_cast<CallInst>(Inst)) {
Intrinsic::ID VectorID = getVectorIntrinsicIDForCall(CI, &TLI);
- if (VectorID == Intrinsic::not_intrinsic)
+ if (VectorID == Intrinsic::not_intrinsic ||
----------------
david-arm wrote:
Instead of this change, if you add the pseudoprobe intrinsic to the list in `LoopVectorizationCostModel::collectLoopUniforms` does this also fix your test? The list is here:
```
// Scan the loop for instructions which are either a) known to have only
// lane 0 demanded or b) are uses which demand only lane 0 of their operand.
for (auto *BB : TheLoop->blocks())
for (auto &I : *BB) {
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(&I)) {
switch (II->getIntrinsicID()) {
case Intrinsic::sideeffect:
case Intrinsic::experimental_noalias_scope_decl:
case Intrinsic::assume:
case Intrinsic::lifetime_start:
case Intrinsic::lifetime_end:
if (TheLoop->hasLoopInvariantOperands(&I))
AddToWorklistIfAllowed(&I);
break;
default:
break;
}
}
```
I think it probably needs adding to the list in `VPRecipeBuilder::handleReplication` as well for the scalable vectors case, e.g.
```
if (!IsUniform && Range.Start.isScalable() && isa<IntrinsicInst>(I)) {
switch (cast<IntrinsicInst>(I)->getIntrinsicID()) {
case Intrinsic::assume:
case Intrinsic::lifetime_start:
case Intrinsic::lifetime_end:
```
https://github.com/llvm/llvm-project/pull/185347
More information about the llvm-commits
mailing list