================ 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); ---------------- ABataev wrote: > 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. Wait, what? Why is EmitAtomicCompareExchange returning a first-class aggregate? Just have it return a std::pair of values. That will also let you return an RValue for the current value, which is probably more generally useful to its callers.
http://reviews.llvm.org/D6499 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
