2 Commits

Author SHA1 Message Date
Ramkumar Ramachandra
110ec1863a LoopVectorize/iv-select-cmp: add test for decreasing IV, const start
The most straightforward extension to D150851 would involve a loop with
decreasing induction variable, with a constant start value.
iv-select-cmp.ll only contains a negative test for the decreasing
induction variable case when the start value is variable, namely
not_vectorized_select_decreasing_induction_icmp. Hence, add a test for
the most straightforward extension to D150851, in preparation to
vectorize:

  long rdx = 331;
  for (long i = 19999; i >= 0; i--) {
    if (a[i] > 3)
      rdx = i;
  }
  return rdx;

Differential Revision: https://reviews.llvm.org/D156152
2023-07-26 14:15:26 +01:00
Mel Chen
4ddc1745a8 [LV] Add tests for select-cmp reduction pattern. (NFC)
The test cases for selecting increasing integer induction variable.

Reviewed By: fhahn, shiva0217

Differential Revision: https://reviews.llvm.org/D153936
2023-07-19 20:17:36 -07:00