[PATCH] [OPENMP] CodeGen for "omp atomic read [seq_cst]" directive.
John McCall
rjmccall at gmail.com
Mon Jan 5 00:08:54 PST 2015
How are you planning to implement stores for any of the non-simple l-value cases? Compare-and-swap loops?
Bitfields are interesting because IRGen actually uses larger-than-strictly-necessary accesses: if you have a struct containing 12 bytes of adjacent bitfields, we will join them all into one large i96 access. You need to use narrower bounds than that because you need something that's guaranteed stable: you can't have one version of the compiler trying to access the bitfield with a 12-byte atomic access and another accessing it with a 4-byte access, because the atomic runtime functions don't promise that such accesses will actually be atomic w.r.t. each other. You'll need to invent a rule here that you're willing to stick to forever.
Also, both bitfields and vector elements can often be accessed more efficiently than just a libcall, depending on how much space they need.
================
Comment at: test/OpenMP/atomic_read_codegen.c:28
@@ +27,3 @@
+typedef int v4si __attribute__((__vector_size__(16)));
+v4si v4six;
+
----------------
This ends up being an inadvertently confusing variable name, since it ends in "six".
http://reviews.llvm.org/D6431
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list