[FastISel] Insert patchpoint instruction before the target generated call instruction.
[oota-llvm.git] / lib / CodeGen / AtomicExpandLoadLinkedPass.cpp
index c7cc4bcb1cb69c5f23ad914e1154c49822c0c253..421946ded40b3659fc2bf87de187ade7c1c96201 100644 (file)
@@ -186,7 +186,7 @@ bool AtomicExpandLoadLinked::expandAtomicRMW(AtomicRMWInst *AI) {
     NewVal = Builder.CreateAnd(Loaded, AI->getValOperand(), "new");
     break;
   case AtomicRMWInst::Nand:
-    NewVal = Builder.CreateAnd(Loaded, Builder.CreateNot(AI->getValOperand()),
+    NewVal = Builder.CreateNot(Builder.CreateAnd(Loaded, AI->getValOperand()),
                                "new");
     break;
   case AtomicRMWInst::Or: