llvm-project
bac95752 - [flang] Reset all extents to zero for empty hlfir.elemental loops. (#124867)

Commit
283 days ago
[flang] Reset all extents to zero for empty hlfir.elemental loops. (#124867) An hlfir.elemental with a shape `(0, HUGE)` still runs `HUGE` number of iterations when expanded into a loop nest. HLFIR transformational operations inlined as hlfir.elemental may execute slower comparing to Fortran runtime implementation. This patch adds an option for BufferizeHLFIR pass to reset all upper bounds in the elemental loop nests to zero, if the result is an empty array. A separate patch will enable this option in the driver after I do more performance testing. The option is off by default now.
Author
Parents
Loading