This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add `co_reduce` to the list of intrinsics and update test
Needs ReviewPublic

Authored by ktras on May 1 2023, 6:16 PM.

Details

Summary

Add the collective subroutine, co_reduce, to the list of
intrinsic subroutines. Move the check in ApplySpecificChecks()
for the intrinsic function, reduce, to a new function that can
perform the same checks on co_reduce as well. Add to the new
function, CheckReduceAndCoReduce, the additional checks that
only apply for the operation argument for co_reduce. Also
change the check for the volatile attribute on the operation
argument for reduce and co_reduce to a check for the value
attribute, since that is the attribute that is disallowed by the
standard. Update the co_reduce and reduce semantics tests.

Diff Detail

Event Timeline

ktras created this revision.May 1 2023, 6:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2023, 6:16 PM
ktras requested review of this revision.May 1 2023, 6:16 PM
ktras added inline comments.May 1 2023, 6:22 PM
flang/lib/Evaluate/intrinsics.cpp
2807

Here, I have transformed the string with the name of the intrinsic, if it is reduce, to match the form of the error messages that occurred before this patch for the reduce intrinsic. However, I don't have to do this. I am happy to do whatever is preferred. At the moment, for other error messages for other intrinsics, some of them have the intrinsic name and the argument names in all caps, and some have them all in lower case, so I wasn't sure which pattern I should try to match.