[LLVMdev] Atomic ops cannot be built from C/OCaml bindings

Jonathan Ragan-Kelley jrk at csail.mit.edu
Wed Oct 24 13:02:54 PDT 2012


I finally got around to adding these.

The patch is posted in a pull request on my copy of llvm.git:

  https://github.com/jrk/llvm/pull/3

and a simple test with OCaml is here:

  https://gist.github.com/3948460

Feedback welcome.

On Sep 14, 2012, at 7:53 PM, Jonathan Ragan-Kelley <jrk at csail.mit.edu> wrote:

> Forgive me if I'm missing something obvious, but it seems that a
> number of core instructions—I'm specifically running in to
> `atomicrmw`, `fence`, and `cmpxchg` at the moment—cannot be
> constructed from the C bindings, and are therefore also inaccessible
> to the OCaml bindings. There are opcodes for each of these in the
> llvm-c/Core.h, but there seems to be no way to construct them.
> 
> Is there a reason these should be omitted?
> 
> (I am currently running into this trying to use NVPTX, where CUDA
> atomics are largely built from the native atomic instructions, in a
> compiler written in OCaml.)
> 
> Thanks.





More information about the llvm-dev mailing list