For global reg lvalue - use regular store through global register.
For simple lvalue - use simple atomic store.
For bitfields, vector element, extended vector elements - the original value of the whole storage (for vector elements) or of some aligned value (for bitfields) is atomically read, the part of this value for the given lvalue is modified and then use atomic compare-and-exchange operation to try to atomically write modified value (if it was not modified).
Also, changes in this patch fix the bug for '#pragma omp atomic read' applied to extended vector elements.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CGStmtOpenMP.cpp | ||
---|---|---|
859 ↗ | (On Diff #19209) | Shouldn't you use monotonic ordering if the omp write isn't seq_cst? |
Yes, of course, just this patch was prepared before last update for
atomics. I'll update patch for sure.
Best regards,
Alexey Bataev
Software Engineer
Intel Compiler Team
16.02.2015 10:58, David Majnemer пишет:
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:859
@@ +858,3 @@
+ else
+ CGF.EmitAtomicStore(ExprRValue, XLValue, /*isInit=*/false);+ // OpenMP, 2.12.6, atomic Construct
Shouldn't you use monotonic ordering if the omp write isn't seq_cst?
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
If you've verified that the changes to the memory ordering flags in the tests are wanted, then this looks good to me.
John, thanks for the review! Yes, I checked this.
Best regards,
Alexey Bataev
Software Engineer
Intel Compiler Team
27.02.2015 5:57, John McCall пишет:
If you've verified that the changes to the memory ordering flags in the tests are wanted, then this looks good to me.
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/