[PATCH] D26602: [DAGCombiner] do not fold (fmul (fadd X, 1), Y) -> (fmad X, Y, Y) by default

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 09:35:25 PST 2016


spatel added a comment.

I started an llvm-dev thread specifically for this case:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/107276.html

1. The consensus is that we cannot do this transform: x * (y + 1) --> x * y + x ...using just FPOpFusion::Fast, so we're confident that the current codegen is buggy.

2. I think everyone agrees that we can do the transform if we have both TargetOptions::UnsafeFPMath and TargetOptions::NoInfsFPMath.

3. There's an unanswered question of whether we can do this with FPOpFusion::Fast with TargetOptions::NoInfsFPMath. That depends on whether x * y + x is always more precise than the original x * (y + 1).


https://reviews.llvm.org/D26602





More information about the llvm-commits mailing list