This is an archive of the discontinued LLVM Phabricator instance.

[OMPIRBuilder] Add support for atomic compare
ClosedPublic

Authored by tianshilei1992 on Jan 29 2022, 4:39 PM.

Details

Summary

This patch adds the support for atomic compare in OMPIRBuilder.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Jan 29 2022, 4:39 PM
tianshilei1992 requested review of this revision.Jan 29 2022, 4:39 PM
Herald added a project: Restricted Project. · View Herald Transcript
tianshilei1992 edited the summary of this revision. (Show Details)Jan 29 2022, 7:47 PM
jdoerfert added inline comments.Jan 30 2022, 1:16 PM
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
1347

Brief documentation, prefer an enum class, potentially in OpenMPConstants.h

1372

Op is missing above.

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
3531

Once you use a conditional and once a ternary op. Maybe use a helper lambda instead.
Signedness has to come from the user.

nikic added a subscriber: nikic.Jan 30 2022, 1:19 PM
nikic added inline comments.
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
3488

Should be X.ElemTy.

jdoerfert added inline comments.Jan 30 2022, 1:34 PM
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
3488

I have to start paying attention to the getPointerElementType uses.

tianshilei1992 marked 5 inline comments as done.Jan 31 2022, 9:01 AM

rebase and remove unused arguments

rebase and remove unused comments

jdoerfert accepted this revision.Feb 2 2022, 12:13 PM

LG, minor things to address

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
3490

assertions don't go into LLVM_DEBUG.

3504

assertions should have a message

3523

SMin, SMax

llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
3078

Add SMax test too.

This revision is now accepted and ready to land.Feb 2 2022, 12:13 PM
tianshilei1992 marked an inline comment as done.Feb 2 2022, 12:20 PM
tianshilei1992 added inline comments.
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
3523

There is no value called SMin or SMax.

tianshilei1992 marked an inline comment as done.

fix comments

tianshilei1992 marked 3 inline comments as done.Feb 2 2022, 12:22 PM
This revision was landed with ongoing or failed builds.Feb 2 2022, 12:39 PM
This revision was automatically updated to reflect the committed changes.