Skip to content

Commit da488ba

Browse files
vzakhariIanWood1
authored andcommitted
[flang] Fetch the initial reduction value from the input array. (llvm#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 1663362 commit da488ba

5 files changed

+815
-40
lines changed

0 commit comments

Comments
 (0)