Extend and perform the lowering in the wider type if provided. This
provides a sort of lower with combined widen scalar action.
widenScalar will always widen and produce the original opcode in a
wider type, whereas this will use different opcodes.
This ends up saving an instruction in the uaddsat case. If you know
you are widening, the add in the wider result can't overflow so only
the clamp of the maximum value is needed. In other cases, it can avoid
introducing more instructions that need further widening, saving
avoiding intermediate legalization artifacts.
Use this to handle the sub-32 bit cases for AMDGPU when the clamp
modifier isn't available. This brings the results closer to
SelectionDAG, which duplicates nearly identical expansions of these in
both LegalizeIntegerTypes and LegalizeDAG.
Use APInt::getLowBitsSet?