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

Alexey Bataev a.bataev at hotmail.com
Thu Dec 11 06:25:02 PST 2014


John, here is my answer


================
Comment at: lib/CodeGen/CGAtomic.cpp:985
@@ +984,3 @@
+  // Okay, turn that back into the original value type.
+  if (auto *Result = atomics.tryConvertIntToValue(load))
+    return RValue::get(Result);
----------------
rjmccall wrote:
> Is there a good reason that this has to be conditional rather than just being a single convertIntToRValue method?  It's okay to pass a ReturnValueSlot in.
If some value cannot be bitcasted from Int to ValueType (from Int128 to fp80, for example), we have to create a temp. But we have to create different temps for AtomicLoad() and for AtomicCompareExchange() (here we must create a structure of 2 elements). And these temps must be created only if we were unable to directly cast from int to value type.

http://reviews.llvm.org/D6499

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list