[llvm] [LLVM] Add a C API for creating instructions with custom syncscopes. (PR #104775)

Tim Besard via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 07:24:21 PDT 2024


================
@@ -4309,6 +4332,22 @@ LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,
       singleThread ? SyncScope::SingleThread : SyncScope::System));
 }
 
+LLVMValueRef LLVMBuildAtomicRMWSyncScope(LLVMBuilderRef B,
+                                         LLVMAtomicRMWBinOp op,
+                                         LLVMValueRef PTR, LLVMValueRef Val,
+                                         LLVMAtomicOrdering ordering,
+                                         unsigned SSID) {
+  AtomicRMWInst::BinOp intop = mapFromLLVMRMWBinOp(op);
+
+  SmallVector<StringRef> SSNs;
+  unwrap(B)->getContext().getSyncScopeNames(SSNs);
+  assert(SSID < SSNs.size() && "Invalid SyncScopeID");
----------------
maleadt wrote:

Oh sorry, didn't mean to commit this, this was just for debugging.

https://github.com/llvm/llvm-project/pull/104775


More information about the llvm-commits mailing list