[llvm] [LV] Check if the VF is scalar by VFRange in `handleUncountableEarlyExit`. (PR #135294)
Elvis Wang via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 15 08:28:13 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.
----------------
ElvisWang123 wrote:
I'm not sure if using `Limit range to vector VF only ...` will be more confusing or not. Since it won't change the range when it only contains vector VFs and will limit the range to scalar VF when it contains scalar VF.
Perhaps using `Limit range to scalar VF only and not insert extract, if the range contains the scalar VF` is better?
https://github.com/llvm/llvm-project/pull/135294
More information about the llvm-commits
mailing list