[llvm] [LV] Check if the VF is scalar by VFRange in `handleUncountableEarlyExit`. (PR #135294)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 16 03:23:22 PDT 2025
================
@@ -2435,8 +2437,12 @@ void VPlanTransforms::handleUncountableEarlyExit(
ExitIRI->addOperand(IncomingFromLatch);
ExitIRI->extractLastLaneOfOperand(MiddleBuilder);
}
+
+ auto IsVector = [](ElementCount VF) { return VF.isVector(); };
// Add the incoming value from the early exit.
- if (!IncomingFromEarlyExit->isLiveIn() && !Plan.hasScalarVFOnly()) {
+ if (!IncomingFromEarlyExit->isLiveIn() &&
+ // Limit range to scalar VF only, if the range contains the scalar VF.
----------------
sdesmalen-arm wrote:
The code below `if (.. & getDecisionAndClampRange(IsVector, Range))` only applies to vectors and so only applies if Range does not contain any scalar VF. Perhaps you can say that the entire transform is different for vector VFs, as it requires an additional extract element, and so the range needs clamping.
https://github.com/llvm/llvm-project/pull/135294
More information about the llvm-commits
mailing list