After reading the LLVM source again, I noticed that LLVM treats atomic exchanges as a read-modify-write. While it doesn't actually support considering exchanges in its idempotence checks, we probably should.
Fold exchanges into RMWs by making them another kind of RMW operator;
Add atomic_exchange(x, kv(x)) to the algebra setup as an idempotence rule.
After reading the LLVM source again, I noticed that LLVM treats atomic exchanges as a read-modify-write. While it doesn't actually support considering exchanges in its idempotence checks, we probably should.
atomic_exchange(x, kv(x))
to the algebra setup as an idempotence rule.