This makes a lot of sense to me, and the patch LGTM. Please commit. I wonder if we want to distinguish between an early, canonicalizing peephole and a late target-specific peephole? Certainly, this patch is fine, just food for thought if this ever comes up. http://reviews.llvm.org/D3905