2 Commits

Author SHA1 Message Date
Zahira Ammarguellat
d8bfd7c63a
[OpenMP] Fix iteration count for nested triangular OpenMP loops (#190153)
This patch restricts the triangular loop iteration count optimization to
only apply to nested triangular loops (`depth >= 2`), not first-level
triangular loops.
The optimization computes iterations as `(Upper - Lower + 1`) for
triangular loops where the inner loop bound depends on an outer loop
counter. However, this formula only works correctly for deeply nested
triangular dependencies: `k` depends on `j`, and `j` itself depends on
`i` For first-level triangular loops: `k` depends directly on `i`, the
standard iteration count formula handles the calculation correctly.
2026-04-02 13:24:00 -04:00
Zahira Ammarguellat
4a26b1f20e
[OpenMP] Enable collapse handling in triangular loops. (#184674)
These changes ensure that triangular loops are handled correctly when
calculating the number of iterations in OpenMP loops with `collapse`.
2026-03-05 05:11:10 -05:00