When condops aren't available, these transformations are performed in lowerSELECT or in a DAGCombine on RISCVISD::SELECT_CC. This patch performs the first two of these combines, which are unconditionally profitable when conditional operations are enabled.
I'm posting this for comment on the general approach of performing this transformation as a dagcombine on select, and get feedback on the desirability of performing it even when condops aren't available (right now it causes a slight regression in a couple of the tests in min-max.ll). There are obviously a number of other condops related regressions, but this seemed like a relatively easily separable initial step. I'll also note that it's not possible to remove this transformation from lowerSELECT (and just rely on the ISD::SELECT combine) without causing codegen regressions, because a select might be produced through legalisation and lowered before the dag combiner runs again.