[PATCH] D17950: Implement is_always_lock_free

Ben Craig via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 16 07:21:56 PDT 2016


bcraig added a subscriber: bcraig.

================
Comment at: lib/Frontend/InitPreprocessor.cpp:305
@@ +304,3 @@
+    if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
+        TypeWidth <= InlineWidth)
+      return Always;
----------------
On some targets (like Hexagon), 4-byte values are cheap to inline, but 1-byte values are not.  Clang is spotty about checking this, but TargetInfo::hasBuiltinAtomic seems like the right function to ask, if you have access to it.


http://reviews.llvm.org/D17950





More information about the cfe-commits mailing list