I’m trying to implement mutexes in the LLVM backend I’m writing for my programming language. I’m having trouble figuring out the exact API call, using the OCaml llvm bindings, to generate a cmpxchg
instruction.
I'm using OCaml 4.14.0 and llvm@14.0.6
.
In my research, I found an example using a “build_cmpxchg
,” and I also found a definition of AtomicCmpXchg
as a part of an enum in LLVM’s OCaml bindings. However, I can’t find any function in these bindings that would create this instruction.
What am I missing? How can I tell the LLVM OCaml bindings to add this instruction?