Issue 243725
Summary [Polly] - ScheduleOptimizer tiles loops with no cross-dimension temporal reuse, causing regressions.
Labels new issue
Assignees
Reporter pawan-nirpal-031
    Polly's ScheduleOptimizer applies loop tiling unconditionally
to any tileable band node without checking whether tiling actually improves
cache locality.  When every read access in the SCoP depends on at most one
band dimension (i.e. pure streaming patterns), tiling adds overheads with
zero cache benefit, because there is no data reused across iterations of
different band dimensions.

Kernel ( Inspired from TSVC2 style benchmark )

```cpp
  for (j = 0; j < n; j++)
    {
      x = b[j];
      curr_a = d[0];

      for (i = 0; i < n; i++)
        {
 next_a = d[i+1];
          curr_a = x > c[i] ? curr_a : next_a;
 }

      a[j] = curr_a;
    }
```

The read access pattern is:
- b[j] : depends on outer dim j only
- d[0] : loop invariant
- d[i+1] : depends on inner dim i only
- c[i] : depends on inner dim i only.

No read access depends on both j and i.  Consecutive outer iterations
re-read the same d[] and c[] data which is already in L1 from the previous
iteration. b[j] accesses disjoint elements per outer iteration.  There is no
cross-dimension temporal reuse that tiling could exploit.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to