Generalize scalarization (recently enhanced with D80885) to allow compares as well as binops.
Similar to binops, we are avoiding scalarization of a loaded value because that could avoid a register transfer in codegen.
This requires 1 extra predicate that I am aware of: we do not want to scalarize the condition value of a vector select. That might also invert a transform that we do in instcombine that prefers a vector condition operand for a vector select.
I think this is the final step in solving PR37463:
https://bugs.llvm.org/show_bug.cgi?id=37463
This needs more words i'd say.
https://godbolt.org/z/4tqgwP
I believe the problem we are preventing is the differences in bit patterns for true/false between scalar and vector comparisons.
And there are other variants on other targets. (there's enum, can't find it right now)
Can we just model that new extra cost?