On Wed, 2012-03-28 at 15:57 +0200, Richard Guenther wrote:
> On Tue, Mar 6, 2012 at 9:49 PM, William J. Schmidt
> <wschm...@linux.vnet.ibm.com> wrote:
> > Hi,
> > This is a re-post of the patch I posted for comments in January to
> > address http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18589. The patch
> > modifies reassociation to expose repeated factors from __builtin_pow*
> > calls, optimally reassociate repeated factors, and possibly reconstitute
> > __builtin_powi calls from the results of reassociation.
> > Bootstrapped and passes regression tests for powerpc64-linux-gnu. I
> > expect there may need to be some small changes, but I am targeting this
> > for trunk approval.
> > Thanks very much for the review,
> Hmm. How much work would it be to extend the reassoc 'IL' to allow
> a repeat factor per op? I realize what you do is all within what reassoc
> already does though ideally we would not require any GIMPLE IL changes
> for building up / optimizing the reassoc IL but only do so when we commit
Ah, I take your point. I will look into it. We still need the
additional data structures to allow sorting by factor repeat counts, but
perhaps expanding the builtins can be avoided until it's proven
necessary. The patch as submitted may be slightly easier to implement
and understand, but I agree it would be better to avoid changing GIMPLE
unnecessarily if possible. I'll get back to you shortly.