rengolin added a comment. Is this avoiding a shift plus extend sub, for a shift-extend sub? If so, would be good to add a CHECK-NOT for the extra instructions that you don't want to see. Otherwise, looks good to me. http://reviews.llvm.org/D11569