Don't always:
cast (select (cmp x, y), z, C) --> select (cmp x, y), (cast z), C'
This is something that came up as far back as D26556, and I lost track of it. I suspect that this transform is part of the underlying problem that is inspiring many of the recent proposals that seek to match larger patterns that include a cast op.
If this looks ok, then I can also add the canonicalization in the other direction, so we actively try to get the compare and select to match sizes.
Hm, indeed.
https://godbolt.org/g/9zMbm8