-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added OpenMP 5.0 specification based lowering of atomic read and write #1367
base: fir-dev
Are you sure you want to change the base?
Conversation
5cfa555
to
815a046
Compare
@NimishMishra Will you be able to address the changes requested by Eric and Peixin? |
@kiranchandramohan I got caught up elsewhere. I'll pick this PR on priority. I see Eric is fine with |
065fd89
to
5bf06d4
Compare
@kiranchandramohan Can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give the high priority for this PR? I would like to use PointerLikeModel in Threadprivate codegen.
Except for those code style issues, the function code looks good to me. BTW, it seems that some semantic checks are missing for atomic construct. For example, at most one hint clause can be in atomic construct, and which memory order clauses can be in which atomic construct. Not sure if they are beyond OpenMP 1.1. |
I'll do the code style changes. As far as the semantic checks are concerned, I have verified that they are present in llvm main repository. I did not implement them; they were already there. I'll take this PR on priority. |
5bf06d4
to
75afd50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. Thanks @NimishMishra .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you create a copy of this for upstream llvm-project as well?
I have a couple of points. I can merge this if other reviewers are OK with the patch.
: public mlir::omp::PointerLikeType::ExternalModel< | ||
AlternativePointerLikeModel<T>, T> { | ||
mlir::Type getElementType(mlir::Type pointer) const { | ||
return pointer.cast<T>().getEleTy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once upstreaming is complete we should check with @schweitzpgi whether it is OK for all these types to have the same getElementType
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiranchandramohan There's a little hunch with the upstreaming. I will ask on slack. Meanwhile, I addressed all the nits and pushed an update here. Upstreaming may take a while I guess
fir::PointerType::attachInterface<PointerLikeModel<fir::PointerType>>( | ||
*getContext()); | ||
|
||
fir::HeapType::attachInterface<AlternativePointerLikeModel<fir::PointerType>>( | ||
*getContext()); | ||
|
||
fir::LLVMPointerType::attachInterface< | ||
AlternativePointerLikeModel<fir::PointerType>>(*getContext()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do all these take in a fir::PointerType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It was an error from my end. I have fixed them now.
Yes. I will create a upstream differential for this PR. |
@shraiysh have you reviewed this PR? If you are OK, please approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
75afd50
to
3ea6481
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Note: This PR can no longer be merged since #1570 is merged. Once we reach a consensus on https://reviews.llvm.org/D122725, I will modify this PR too to that end. |
Can you close this now and cherry-pick D122725 ? |
This PR adds PFT to MLIR lowering support for atomic read and write.