[llvm] [LoopVectorize] Vectorize select-cmp reduction pattern for increasing integer induction variable (PR #67812)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 09:59:22 PST 2024


================
@@ -5106,8 +5106,9 @@ LoopVectorizationCostModel::selectInterleaveCount(ElementCount VF,
         HasReductions &&
         any_of(Legal->getReductionVars(), [&](auto &Reduction) -> bool {
           const RecurrenceDescriptor &RdxDesc = Reduction.second;
-          return RecurrenceDescriptor::isAnyOfRecurrenceKind(
-              RdxDesc.getRecurrenceKind());
+          RecurKind RK = RdxDesc.getRecurrenceKind();
+          return RecurrenceDescriptor::isAnyOfRecurrenceKind(RK) ||
+                 RecurrenceDescriptor::isFindLastIVRecurrenceKind(RK);
----------------
Mel-Chen wrote:

I want to confirm whether you're trying to test this message?
```
   if (HasSelectCmpReductions) {
      LLVM_DEBUG(dbgs() << "LV: Not interleaving select-cmp reductions.\n");
      return 1;
```
or if you simply want to see test results without `-force-vector-interleave`?

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


More information about the llvm-commits mailing list