This re-raises some of the open questions about how to apply and use fast-math-flags in IR from PR38086:
https://bugs.llvm.org/show_bug.cgi?id=38086
...but given the current implementation, I think this is the correct way to predicate the transform.
This is part of solving PR39475:
https://bugs.llvm.org/show_bug.cgi?id=39475