[llvm-commits] [PATCH][Fastmath, Instcombine] Enhancement of Fdiv

dag at cray.com dag at cray.com
Tue Jan 15 08:36:52 PST 2013


Shuxin Yang <shuxin.llvm at gmail.com> writes:

> Hi, Steve:
>
>    You are right. I guess we need a "allow reassociation" relax level
> (and it is a medium relax level).
>    I restructure my change (just committed)  in order to easily adapt
> to potential future change.
>   The changes are sketched bellow:
>
>   1) I introduce two bool to guard the transformation:
> "hasReassociate" and "hasReciprocal".  There are
> considered independent in my new code. In the future, if someone
> introduce the "reassociate"-relax level,
> we need only to change the "hasReassociate = xxx" statement, and rest
> code remains unchanged.
>
>   2) (X/C1)/C2 is first transformed into X/(C1*C2), and optionally
> transformed into X* (1/(C1*C2)) if
>      we 1/(C1*C2) is exact, or reciprocal is allowed.

This sounds great.  Thanks!

                             -David



More information about the llvm-commits mailing list