This patch is an alternative to D66725. It provides some minimal changes that allow solving the RISC-V fcopysign issues without being blocked on larger refactoring/restructuring changes such as those of D66725 or D70064.
It gates the DAG combine folding of fp_extend/fp_round "casts" of an fcopysign sign operand when doing so would produce an operand value with an illegal type. (The folding is still done when the original sign value already had an illegal type, as in that case we expect the fcopysign to be expanded and we avoid libcalls for the value extension/rounding).
For clarity, the patch includes the RISC-V tests that motivated the DAGCombiner changes, although those can be committed separately.
Please can you add a comment to note that these patterns will eventually not be needed, once we improve fcopysign handling?