[Openmp-commits] [PATCH] D106310: [Libomptarget] Remove volatile from NVPTX work function
Jon Chesterfield via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jul 20 04:06:36 PDT 2021
JonChesterfield added a comment.
This seems hazardous.
The value is written from one warp and then read from another. It should be atomic qualified, but isn't, because cuda doesn't do that.
Previously it was volatile, which happens to get treated in broadly similar fashion to atomic.
So before it was a data race, but one that the compiler was unlikely to miscompile. Now it's a non-volatile data race. That is indeed more likely to be transformed.
I don't think we can reasonably assume this change is safe. Making it a relaxed atomic instead would be better.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106310/new/
https://reviews.llvm.org/D106310
More information about the Openmp-commits
mailing list