[flang-commits] [flang] [flang] Reset all extents to zero for empty hlfir.elemental loops. (PR #124867)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Wed Jan 29 08:47:24 PST 2025


vzakhari wrote:

> This is a good idea, thanks for your work so far
> 
> > Did you consider keeping the extents untouched but wrapping the loops in a fir.if (!isEmpty)?
> 
> +1 I wonder if this would be easier for LLVM passes to understand.

I thought about it, and decided that introducing CFG might be a little bit harder for the following loop optimizations to reason about adjacent loop nests, thought it is a weak point, because for identical `if (!isEmpty)` it should be possible to merge the then blocks (containing the loop nests).  So this might be not the final solution.

https://github.com/llvm/llvm-project/pull/124867


More information about the flang-commits mailing list