The patch itself is pretty straight forward. I wanted to get a second set of eyes on this mostly to make sure there isn't some cornercase where the type of a unordered load or store effects the lowering in a semantic way. I'm not aware of any, but this is the change which would find them if they exist. :)
p.s. I believe we now support all power of two types for atomic loads and stores. If not, I'll need to add a restriction to the patch. Anyone know of a case?
Add assert(!LI.isVolatile() && "volatile unhandled here") here and below, makes it less likely to break in the future.