This is an archive of the discontinued LLVM Phabricator instance.

[flang] Lower F08 FINDLOC intrinsic
ClosedPublic

Authored by tarunprabhu on Nov 16 2022, 9:24 AM.

Details

Summary

The implementation follows the patterns established by the lowering of other similar intrinsics.

In addition to the code for lowering, the DoTotalReduction template had to be fixed to correctly break when signaled to do so by the accumulator function.

Diff Detail

Event Timeline

tarunprabhu created this revision.Nov 16 2022, 9:24 AM
Herald added a project: Restricted Project. · View Herald Transcript
tarunprabhu requested review of this revision.Nov 16 2022, 9:24 AM
clementval added inline comments.Nov 17 2022, 12:14 AM
flang/runtime/reduction-templates.h
60–61

Is this change needed for findloc?

tarunprabhu marked an inline comment as done.Nov 17 2022, 4:04 AM
tarunprabhu added inline comments.
flang/runtime/reduction-templates.h
60–61

Yes. If the reduction is not short-circuited, only the last occurrence of the value is found.

Other than the fact that this needs a rebase, LGTM, thanks.

flang/test/Lower/Intrinsics/findloc.f90
22

You will need to rebase this tests after https://reviews.llvm.org/D138022 added fastmath<contract> in these calls.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 29 2022, 9:22 AM
This revision was automatically updated to reflect the committed changes.
tarunprabhu marked an inline comment as done.