[PATCH] CodeGen: improve ms instrincics support

Saleem Abdulrasool abdulras at fb.com
Wed Jun 18 13:49:31 PDT 2014


================
Comment at: lib/CodeGen/CGBuiltin.cpp:1540
@@ +1539,3 @@
+
+    Value *Result = Builder.CreateAtomicCmpXchg(Destination, Comparend,
+                                                Exchange,
----------------
Reid Kleckner wrote:
> Saleem Abdulrasool wrote:
> > Reid Kleckner wrote:
> > > MSDN says the 'Dest' is volatile, so I'd call Result->setVolatile(true) here.
> > Dest itself is volatile, the returned value is not.  We dont strip volatility off of Destination.  Oh, and I dont see a llvm::Value::setVolatile either.
> CreateAtomicCmpXchg should return an AtomicRMWInst* which can be made volatile.  It's not the result that's volatile, it's the memory update.
Done (thanks for the clarification!); although needed an additional extract value due to a recent change to the cmpxchg change.

http://reviews.llvm.org/D4182






More information about the cfe-commits mailing list