Rewrite the fsub-0.0 idiom to fneg and always emit fneg for fp negation. This also extends the scalarization cost in instcombine for unary operators to result in the same IR rewrites for fneg as for the idiom.
Just noticed that this is a bug -- it needs a guard for denormal flushing.
When FTZ or DAZ:
fsub -0.0, Denorm ==> +-0 fneg Denorm ==> -Denorm
Handling denormals correctly is an ongoing project. If you'd like to leave this for later, we'll get to it. I see that it's currently broken, so no harm in continuing that way for now.
Could you add a brief FIXME here?
Added a FIXME for now.