Current pass recursively searches definitions backwards to determine if a sext.w is redundant because the value is already in sign-extended form. An instruction propagates a sign-extended definition if giving it a sign-extended input yields a sign-extended output.
This patch adds recursively searching uses forwards to determine if bits 63:32 of sext.w result are not used, so it can be removed. An isntruction propagates sign-extended use if the lower word of its output is only dependent on the lower word of its input.
It also adds a few W instructions to the backwards search.
I have a pending patch dependent on this one that "fixes" other instructions (e.g. ADD -> ADDW) to make a sext.w redundant.
const auto -> const auto *. LLVM coding guidelines want to see the *