This patch complete predicates for fold fcmp-of-copysign
copysign(non-zero constant, X) < 0.0 --> (bitcast X) < 0 copysign(non-zero constant, X) > 0.0 --> (bitcast X) > 0 copysign(non-zero constant, X) <= 0.0 --> (bitcast X) <= 0 copysign(non-zero constant, X) >= 0.0 --> (bitcast X) >= 0
This is not correct if X is 0.0 (0x00000000).
copysign(1.0, 0.0) <= 0.0 is false
(bitcast 0.0) <= 0 is true
Similarly:
copysign(1.0, 0.0) > 0.0 is true
(bitcast 0.0) > 0 is false
I don't think we can verify copysign with Alive2, so please write a test program to check edge values so we know the transform is always correct.