[PATCH] D43398: [InstCombine] allow fdiv folds with less than fully 'fast' ops

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 07:26:44 PST 2018


spatel added a comment.

In https://reviews.llvm.org/D43398#1011150, @wristow wrote:

> > ...but gcc currently says we can do this with just -freciprocal-math
>
> Regardless of what gcc is doing in this case, I think both 'reassoc' and 'arcp' are needed here.  So I think your code is right.


Thanks. I wasn't sure what weight should be given to matching gcc-based customer expectations, so I thought it was worth noting here. Either way, this gets us closer to their behavior because we at least don't have to enable all of -ffast-math.

Any thoughts about the FMF on the fmul? It can be a separate patch if that's preferred, but I think this is the only transform around here that is intersecting FMF. We always propagate flags from the last op to intermediate ops in other cases. That makes more sense to me because the new op only exists to produce an intermediate result for our transformed fdiv, so it should have the same relaxations as the fdiv.


https://reviews.llvm.org/D43398





More information about the llvm-commits mailing list