[PATCH] D25576: Add 64-bit MS _Interlocked functions as builtins again

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 13 14:20:02 PDT 2016


rnk added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:2730
+        llvm::AtomicOrdering::SequentiallyConsistent);
+    return Builder.CreateSub(RMWI, ConstantInt::get(IntTy, 1));
   }
----------------
agutowski wrote:
> rnk wrote:
> > Can you make a helper similar to MakeBinaryAtomicValue for inc/dec and share this code with the 16 and 32-bit atomic increment implementations? You can do something like `Builder.CreateBinOp(Inc ? Instruction::Add : Instruction::Sub, ...)`
> I thought about putting all the _Interlocked intrinsics here. Or do we want all the others to remain target-independent?
Sure, having the target-independent builtins call EmitMSVCBuiltinExpr seems reasonable.


https://reviews.llvm.org/D25576





More information about the cfe-commits mailing list