This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Consistently generate widening multiplies


On Wed, Feb 17, 2010 at 6:17 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 02/17/2010 11:24 AM, Richard Guenther wrote:
>>
>> I think this sort of stuff (and also possible FMA detection) fits
>> in a re-association framework (not necessarily that we have right now,
>> that needs some TLC anyway ...).
>
> That would be between 3 and 4 in the steps of tree-ssa-reassoc?
>
> ? ?1. Breaking up subtract operations into addition + negate, where
> ? ?it would promote the reassociation of adds.
>
> ? ?2. Left linearization of the expression trees, so that (A+B)+(C+D)
> ? ?becomes (((A+B)+C)+D), which is easier for us to rewrite later.
> ? ?During linearization, we place the operands of the binary
> ? ?expressions into a vector of operand_entry_t
>
> ? ?3. Optimization of the operand lists, eliminating things like a +
> ? ?-a, a & a, etc.
>
> ? ?4. Rewrite the expression trees we linearized and optimized so
> ? ?they are in proper rank order.
>
> ?

Yes, basically where we also apply a * b + a * c -> a *  (b + c).

> This is much better than doing it in fwprop.c (which anyway was rewritten so
> you couldn't do it there anymore...).

At least it's worth trying IMHO.

Richard.


>
> Paolo
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]