llvm-project
d8bfd7c6 - [OpenMP] Fix iteration count for nested triangular OpenMP loops (#190153)

Commit
28 days ago
[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.
Author
Parents
Loading