Fold select (fcmp oeq x, 0), (fmul x, y), x => x
This cleans up a pattern left behind by denormal range checks under
denormals are zero.
The pattern starts out as something like:
x = x < smallest_normal ? x * K : x;
The comparison folds to an == 0 when the denormal mode treats input
denormals as zero. This makes library denormal checks free after
linked into DAZ enabled code.
alive2 is mostly happy with this, but there are some issues. First,
there are many reported failures in some of the negative tests that
happen to trigger some preexisting canonicalize introducing
combine. Second, alive2 is incorrectly asserting that denormals must
be flushed with the DAZ modes. It's allowed to drop a canonicalize.
Seems a bit strong to say that fmul nsz MulVal, +0.0 will yield +0.0 when MulVal is negative. I think the nsz flag just means that optimizations applied to this instruction don't have to respect the sign of zero. It's still possible that some other later (non-nsz) instruction would observe a -0.0 result from this fmul.
I think the behaviour is fine but the comment could use improving.