[LLVMdev] Replacing Platform Specific IR Codes with Generic Implementation and Introducing Macro Facilities

Tim Northover t.p.northover at gmail.com
Sat May 10 11:35:57 PDT 2014


> The IR is missing a weak variant of cmpxchg. But is there anything else
> missing at IR level? My understanding was that LLVM’s atomic memory
> ordering constraints are complete, but that codegen is not highly optimized,
> and maybe conservative for some targets. Which idiom do you have trouble
> with on non-x86?

For myself, I don't like the fact that LLVM's atomicrmw & cmpxchg
instructions are so beholden to C. With suitable constraints, an
"atomicrmw [](int x) { ... }" isn't unreasonable; but this can only be
mapped to a cmpxchg loop with the current IR.

Tim.




More information about the llvm-dev mailing list