[PATCH] Combine fmul vector FP constants when unsafe math is allowed

Matt Arsenault arsenm2 at gmail.com
Wed Sep 10 16:25:03 PDT 2014


On Sep 10, 2014, at 6:49 PM, Sanjay Patel <spatel at rotateright.com> wrote:

> I'm now wondering if this patch is necessary. I'd rather not bloat up DAGCombiner any more if there's no reason to.
> 
> The constant reassociations in all 3 of the test cases that I created here are already done by -instcombine if 'fast' is specified on each fmul inst. And in http://reviews.llvm.org/D5222, I've said that 'fast' will be specified for any function produced by clang with -ffast-math.
> 
> Matt, what was the motivation for r215820? Is there some scenario you were seeing where we can't do these folds in -instcombine?
> 
> http://reviews.llvm.org/D5254


Instcombine does not do this transformation, and it’s dependent on the target if it’s worth doing. I also have various cases where fmuls and other math operations are produced by lowering and could be folded further



More information about the llvm-commits mailing list