TODO: handle <=, >, and >=
Thanks for splitting this up and creating the Alive link!
I'm still not clear if the FMF propagation is behaving as well as it could. For example, if the select has nsz, then can it always be added to the fneg?
It would also help to sprinkle some extra flags like nnan and ninf into the tests, so we can tell how those are modified even though they are not required for the transform.
"--> -X" should be "--> -fabs(X)"
We canonicalize fcmp to +0.0, so I think it would be enough to just switch any one of these tests to confirm that.
If the select is nsz, that means that if the result is zero, we don't care about its sign. That means we could copy it onto the fneg, sure. Actually, the produced fabs and fneg should always be nsz; the transform doesn't make sense otherwise.
For other flags, you can probably just copy them from the select? So initialize the flags from the select, then unconditionally enable the nsz bit for both instructions, I guess.