[PATCH] Bugfix for Codegen of atomic load/store ops.

John McCall rjmccall at gmail.com
Mon Dec 8 11:23:58 PST 2014


Hmm.  Using the optimized libcalls is a great idea, but it should be a separate patch.  You also need to mention that you'd like to do this on cfe-dev first, since it does introduce new runtime dependencies, even if they're a documented part of the existing atomics runtime.

================
Comment at: lib/CodeGen/CGAtomic.cpp:1073
@@ -1049,1 +1072,3 @@
 
+static llvm::Value *convertRValueToInt(CodeGenFunction &CGF,
+                                       const AtomicInfo &AI, RValue RVal) {
----------------
Consider making this a method on the AtomicInfo.

================
Comment at: lib/CodeGen/CGAtomic.cpp:1274
@@ +1273,3 @@
+  // Other decoration.
+  if (Obj.isVolatileQualified())
+    Inst->setVolatile(/*V=*/true);
----------------
Inst->setVolatile(Obj.isVolatileQualified());
Inst->setWeak(IsWeak);

================
Comment at: lib/CodeGen/CGAtomic.cpp:1282
@@ +1281,3 @@
+
+  // The easiest way to do this this is to go through memory, but we
+  // try not to in some easy cases.
----------------
This part should also be a method on the AtomicInfo, or at least its own helper function.  convertIntToRValue?

We probably have the same code in the atomic-load path.

http://reviews.llvm.org/D6499






More information about the cfe-commits mailing list