[PATCH] Reassociate x + -0.1234 * y into x - 0.1234 * y

Erik Verbruggen erikjv at me.com
Thu Aug 21 03:56:06 PDT 2014


Committed as revision 216169.

Thanks!

-- Erik.

On 19 Aug 2014, at 17:40, Chad Rosier <mcrosier at codeaurora.org> wrote:

> LGTM.  Let me know if you need me to push the commit.
> 
> Chad
> 
> ================
> Comment at: lib/Transforms/Scalar/Reassociate.cpp:1986
> @@ +1985,3 @@
> +    // Transform:
> +    //   FAdd(x, FMul(-0.1234, y)) -> FSub(x, FMul(0.1234, y))
> +    // where the FMul can also be an FDiv, and FAdd can be a FSub.
> ----------------
> We can be more generic here:
> FAdd(x, FMul(-ConstantFP, y)) -> FSub(x, FMul(ConstantFP, y))
> 
> I actually prefer
> 
> // Reassociate: x + -ConstantFP * y -> x - ConstantFP * y
> 
> but I'll let you decide.
> 
> http://reviews.llvm.org/D4904
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list