Commit ef48e904 authored by Ramkumar Ramachandra's avatar Ramkumar Ramachandra
Browse files

LoopVectorize/iv-select-cmp: add test for decreasing IV out-of-bound

The most straightforward extension to D150851 would involve handling the
decreasing IV case, for which tests have been added in 110ec186
(LoopVectorize/iv-select-cmp: add test for decreasing IV, const start).
However, the commit missed a testcase for the out-of-bound sentinel
value LONG_MAX, which should not be vectorized. Fix this by adding a
test corresponding to the following program:

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

Differential Revision: https://reviews.llvm.org/D157969
parent b7ff0320
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment