This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Add lowering for min operator
ClosedPublic

Authored by clementval on May 29 2023, 8:00 PM.

Details

Summary

Add lowering support for the min operator
in reduction clause.

Depends on D151565

Diff Detail

Event Timeline

clementval created this revision.May 29 2023, 8:00 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 29 2023, 8:00 PM
clementval requested review of this revision.May 29 2023, 8:00 PM
razvanlupusoru added inline comments.May 30 2023, 9:01 AM
flang/lib/Lower/OpenACC.cpp
545

I think there's a way to check for signedness on integer type. It might make sense to add assert here and ensure that F18 marks that flag on integer type it produces. I am okay doing it in a separate patch. I just don't feel right to try to get the max signed value without additional checking.

556

Spacing problem for this line and a few others below.

594

Is there a way to ensure the use of ordered/unordered compare is consistent with other parts of F18?

clementval added inline comments.May 31 2023, 4:31 PM
flang/lib/Lower/OpenACC.cpp
545

Sure I can add that in the follow up patch.

556

This is not showing tab vs space AFIAK

594

Easiest way would be to use the FirOpBuilder and use the same helper here and in the intrinsic lowering.

jeanPerier added inline comments.Jun 13 2023, 5:39 AM
flang/lib/Lower/OpenACC.cpp
594

Use genMin as recommend by reviewer

jeanPerier accepted this revision.Jun 14 2023, 5:29 AM

Thanks, LGTM

This revision is now accepted and ready to land.Jun 14 2023, 5:29 AM
This revision was automatically updated to reflect the committed changes.