[llvm-commits] [PATCH] [Fast-math] In relaxed FP mode, Instruction::isAssociative() returns true for fmul/fadd

Michael Ilseman milseman at apple.com
Wed Nov 28 13:58:52 PST 2012


LGTM, but I'll let the code owner or someone more knowledgeable/senior comment on it.

On Nov 28, 2012, at 1:52 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:

> Hi,
> 
>   The tiny patch attached to this mail is to let Instruction::isAssociative() return true for fmul/fadd
> if the compiler is using relaxed floating-point mode.
> 
>    I thought this change could open a big can of worm. Turn out we are fortunate. I stress-tested
> the change by *ALWAYS* considering fmul/fadd as reassociative regardless which fp mode the
> compiler is using, and I tested regression test, SingleSrc, MultipleSrc.  I only saw one regression:
> test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll, which is false-positive.
> 
>   It seems that Instcombine is transparently doing a great job for FP operators
> if Instrunction::isAssociative() returns true.
> 
> Thanks you for review.
> 
> Shuxin
> 
> 
> 
> 
> <fast_math_isassociative.patch>_______________________________________________
> 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