This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Support .and. reduction operator
ClosedPublic

Authored by clementval on Jul 10 2023, 2:52 PM.

Details

Summary

Add support for the .and. reduction operator
in Flang/OpenACC lowering.

Depends on D154888

Diff Detail

Event Timeline

clementval created this revision.Jul 10 2023, 2:52 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 10 2023, 2:52 PM
clementval requested review of this revision.Jul 10 2023, 2:52 PM
razvanlupusoru added inline comments.Jul 10 2023, 3:28 PM
flang/lib/Lower/OpenACC.cpp
704

What happens if integer type is used with .and. operator? What concerns me here is by checking on type, it assumes that operand is logical type. Maybe it might be better to check for operator, then check for logical type (and generate error if not true).

707

Representation for true is decided by the frontend. Although it is 1 for F18, it seems it would be better to call some fir:: utility to get this value so that it is in a single place.

Address review comments

clang-format

clementval marked 2 inline comments as done.Jul 10 2023, 3:49 PM
clementval added inline comments.
flang/lib/Lower/OpenACC.cpp
704

Switch to check type first and add an assert.

707

Good point. I switched to use builder.createBool which as the logic inside.

razvanlupusoru accepted this revision.Jul 12 2023, 11:18 AM

Thank you for addressing my comments. Looks good now!

This revision is now accepted and ready to land.Jul 12 2023, 11:18 AM
This revision was automatically updated to reflect the committed changes.
clementval marked 2 inline comments as done.