Skip to content

Commit 7dad8b9

Browse files
authored
[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.
1 parent 92b03e4 commit 7dad8b9

5 files changed

+815
-40
lines changed

0 commit comments

Comments
 (0)