LLVM has 3 instructions made for use in a parallel environment: fence, cmpxchg, and atomicrmw. There are multiple ways to handle these:
- No support. Emit a warning when it is encountered, and treat it like a no-op. This is what we currently do.
- Support, but assume single thread. For example,
cmpxchg would do the compare-and-exchange, but the exchange would always be successful in the model generated,
- Support parallel programs in general. This is very hard, and I don't even know where to begin.
LLVM has 3 instructions made for use in a parallel environment:
fence,cmpxchg, andatomicrmw. There are multiple ways to handle these:cmpxchgwould do the compare-and-exchange, but the exchange would always be successful in the model generated,