llvm-project
7dad8b91 - [flang] Fetch the initial reduction value from the input array. (#136790)

Commit
154 days ago
[flang] Fetch the initial reduction value from the input array. (#136790) Instead of using loop-carried IsFirst predicate, we can fetch the initial reduction values for MIN/MAX LOC/VAL reductions from the array itself. This results in a little bit cleaner loop nests, especially, generated for total reductions. Otherwise, LLVM is able to peel the first iteration of the innermost loop, but the surroudings of the peeled code are executed multiple times withing the outer loop(s). This patch does the manual peeling, which only works for non-masked reductions where the input array is not empty.
Author
Parents
Loading