[llvm] [C API] Fix LLVMGetOrdering/LLVMIsAtomicSingleThread for fence/memory instrs (PR #65228)

Benji Smith via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 30 06:09:49 PDT 2023


================
@@ -3769,6 +3771,8 @@ void LLVMSetOrdering(LLVMValueRef MemAccessInst, LLVMAtomicOrdering Ordering) {
 
   if (LoadInst *LI = dyn_cast<LoadInst>(P))
     return LI->setOrdering(O);
+  else if (FenceInst *FI = dyn_cast<FenceInst>(P))
+    return FI->setOrdering(O);
----------------
Benjins wrote:

I can add this as well. My understanding is that the bindings tests will not use that, since it uses `LLVMBuildAtomicRMW` to set the ordering directly. Is that okay?

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


More information about the llvm-commits mailing list