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] Builtins handling in IVOPT


Hi,

> >> > If a pointer typed use is plainly value passed to a func call, it is
> >> > not an address use, right? But as you said, x86 lea may help here.
> >>
> >> But that's what you are matching ... (well, for builtins you know
> >> will expand that to a memory reference).
> >>
> >> What I dislike in the patch is the special-casing of some builtins
> >> via a target hook.  I'd rather say treat all internal functions and
> >> all target builtins that way.  Or simply all addresses.
> >
> > unless the architecture has lea-type instruction to compute the address,
> > computing say b+4*i incurs some cost, while if mem[b+4*i] is accessed, the
> > computation is for free.  Thus, it does not make sense to treat the address
> > computations the same way as memory references (or to treat all functions
> > the same way as builtins which translate to memory references),
> 
> I understand that, but I think the patch tries to improve code generation
> not by changing the set of IVs used (thus adjust cost considerations)
> but by changing the way it rewrites certain address uses.

actually, the costs are adjusted in the patch -- the address calculations
for the handled builtins are recorded as USE_ADDRESS (not as USE_NONLINEAR_EXPR),
so that their costs are calculated in the same way as for memory references,

Zdenek


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