This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add atomic_cas to the list of intrinsics
ClosedPublic

Authored by ktras on Oct 12 2022, 5:51 PM.

Details

Summary

Add the atomic subroutine, atomic_cas, to the list of intrinsic subroutines and check one of its arguments for a coindexed object. Create a new function, CheckAtomicKind, that will be used for the atomic subroutines that have arguments that can be either of type int and of kind atomic_int_kind or of type logical and of kind atomic_logical_kind. In this patch, this function is only called once, but it will be called in an upcoming planned patch, which is why it is an additional function, as opposed to using the code in place of the function call.

Diff Detail

Event Timeline

ktras created this revision.Oct 12 2022, 5:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 5:51 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
ktras requested review of this revision.Oct 12 2022, 5:51 PM
jeanPerier added inline comments.Oct 13 2022, 2:57 AM
flang/lib/Evaluate/intrinsics.cpp
1347

If arg must not be a nullptr, better use const ActualArgument &arg here and push the responsibility of passing something non null on the caller.

ktras updated this revision to Diff 467508.Oct 13 2022, 9:37 AM

Update function signature of new function, CheckAtomicKind, based on reviewer feedback.

ktras marked an inline comment as done.Oct 13 2022, 9:38 AM
ktras added inline comments.
flang/lib/Evaluate/intrinsics.cpp
1347

Thanks, the changes have been made.

ktras marked an inline comment as done.Oct 13 2022, 9:39 AM
jeanPerier accepted this revision.Oct 18 2022, 12:39 AM

Thanks, LGTM

This revision is now accepted and ready to land.Oct 18 2022, 12:39 AM
This revision was automatically updated to reflect the committed changes.