support LLVM build

LLVM changed semantics of cmpxchg instruction, so we have to change too.