[llvm] [LV] Vectorize selecting last IV of min/max element. (PR #141431)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 05:26:49 PST 2025


================
@@ -225,6 +270,10 @@ bool RecurrenceDescriptor::AddReductionVar(
   if (Phi->getParent() != TheLoop->getHeader())
     return false;
 
+  if (isMinMaxReductionWithLoopUsersOutsideReductionChain(Phi, Kind, TheLoop,
----------------
ayalz wrote:

```suggestion
  // Check for min/max reduction variables that feed other users in the loop.
  if (isMinMaxReductionWithLoopUsersOutsideReductionChain(Phi, Kind, TheLoop,
```

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


More information about the llvm-commits mailing list