These should preserve the fast math flags on the initial fcmp.
Without this, the nodes may later be expanded to use an
unnecessary quieting operation.
Is this just about 'nnan' behavior? If so, can we just use/expand the existing SelectPatternNaNBehavior?
IOW, why is 'nsz' relevant?
Eli raised a question about 'nsz' on fcmp:
Does the motivation for this patch make any of the proposed fixes more or less appealing?
Regardless to any answers to the above, I think we should split this into separate IR/DAG patches with tests for each side.
The combine to form minnum/maxnum from cmp/select depends on nsz. The DAG version of the combine checks the global NSZ flag, but I think the direct-from-ir version is broken. I've never really liked the matching here in SelectionDAGBuilder, but haven't looked into what regresses if I try just ripping out the IR matching.
There's also another bug from doing this I've noticed, where the dead nodes are left which breaks hasOneUse optimizations