Materializing constants on RISCV is simpler if the constant is sign
extended from i32. By default i32 constant operands of phis are
zero extended.
This patch adds a hook to allow RISCV to override this for i32. We
have an existing isSExtCheaperThanZExt, but it operates on EVT which
we don't have at these places in the code.
The comment about "this" constant is a little incongruous as no constant is provided. Even if RISC-V doesn't need it, I can imagine situations where targets may choose to sign-extend some specific constants and not others, so it may make sense to pass the Constant to this API.