Open arnamoy10 opened 2 years ago
@arnamoy10 Can you read the discussion in https://discourse.llvm.org/t/rfc-privatisation-in-openmp-dialect/3526?
I think the lastprivate handling is not done in the body of the loop in the llvm it generated but it is in the footer or exit portion of the loop. We do not have a representation for the footer/exit portion of the loop in omp.wsloop
. So we are forced to add a condition inside the body of the loop that checks whether it is the last iteration and then do an update.
I can explain more if required.
Q: is there a related phabricator review to this PR? Thanks for working on this.
@schweitzpgi Thanks for asking, unfortunately, privatization implementation, for now, has to be done in fir-dev
, through pull req style. Here is the relevant discussion in slack
Q: is there a related phabricator review to this PR? Thanks for working on this.
@schweitzpgi Is a phabricator review what you would prefer for OpenMP work?
Q: is there a related phabricator review to this PR? Thanks for working on this.
@schweitzpgi Is a phabricator review what you would prefer for OpenMP work?
See Steve's announcement here. https://discourse.llvm.org/t/nvidia-transition-from-fir-dev/61947
I think transitioning to working upstream, in so far as it is possible to do so, would be a good direction.
Thanks for the comment @kiranchandramohan . From this C++ OpenMP example, looking at the diff between with and without the use of
lastprivate
, it looked like the change necessary was just to add a load and store of thelastprivate
variable at the end of the loop. I did not see any code that checks the last iteration's value. I was under the impression that OpenMP runtime calls will take care of that.It will be great if you can point to the part of the IR that ensures it.