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] Fix canonicalization of addresses


> The performance should be "killed" only from within loops, right?  So
> I still think that IVOPTs should properly handle this case.

I'm not sure why loops should come into play.  Canonicalization and CSE should 
be independent from the presence of loops in the code.

> Note that the original patch just decided for
>
> "	      /* No identical multiplicands; see if we can find a common
> 		 power-of-two factor in non-power-of-two multiplies.  This
> 		 can help in multi-dimensional array access.  */"
>
> instead of the conflicting
>
> "   We also canonicalize (X + 7) * 4 into X * 4 + 28 in the hope that
> either the machine has a multiply-accumulate insn or that this is part of
> an addressing calculation."

Your canonicalization is more tree-oriented, the original canonicalization was 
more RTL-oriented.  I tried various things in pure RTL (simplify-rtx.c) but, 
in the end, nothing works as effectively as flipping the canonicalization for 
offsets when they are still trees.

-- 
Eric Botcazou


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