If we're already shifting right we can trade the AND for a SHL to clear out the upper bits before the shift right. This can avoid a constant pool on the AND.
This patch doesn't currently work for AND's with power 2 since those get turned into shuffles and only become ANDs again during the last lowering step. At which point the mask is in a constant pool. We can probably look through the constant pool to fix this, but I haven't looked at that yet.