Expand on Quentin's r353471 patch which converts some atomicrmws into loads. Handle remaining operation types, and fix a slight bug. Atomic loads are required to have alignment. Since this was within the InstCombine fixed point, somewhere else in InstCombine was adding alignment before the verifier saw it, but still, we should fix.
Terminology wise, I'm using the "idempotent" naming that is used for the same operations in AtomicExpand and X86ISelLoweringInfo. Once this lands, I'll add similar tests for AtomicExpand, and move the pattern match function to a common location. Any suggestions as to where?
The last thing we should probably do - not in this patch - is to canonicalize the operation for any idempotent atomicrmw which we can't convert to a load. I was thinking to have "atomicrmw or, ptr, 0" be the canonical choice. Thoughts?