This commit teaches InstCombine how to replace an atomicrmw operation
into a simple load atomic.
For a given atomicrmw <op>, this is possible when:
- The ordering of that operation is compatible with a load (i.e., anything that doesn't have a release semantic).
- <op> does not modify the value being stored
Any plans to handle the other obvious cases such as xor, and, etc?
On the inverse side, we can do the same thing converting to a blind store. e.g. and w/zero, or max w/INT_MAX.
Just curious as to what plans here are.