This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Builtins handling in IVOPT
- From: Zdenek Dvorak <rakdver at iuuk dot mff dot cuni dot cz>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Wei Mi <wmi at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>
- Date: Fri, 22 Nov 2013 15:11:29 +0100
- Subject: Re: [PATCH] Builtins handling in IVOPT
- Authentication-results: sourceware.org; auth=none
- References: <CA+4CFy7_1JO7r3eq8TWzotR1L6oGKkecZx24OvBd8yeXKcshWQ at mail dot gmail dot com> <CAFiYyc192S2FxNiaeOd6tCvOi0XBfi2arCd4Obf+sckkfwja3g at mail dot gmail dot com> <CA+4CFy6Qcsd1H=zm=LXGJ1c=E_aTcDU-WXAn0eXHmqBAC3z6PA at mail dot gmail dot com> <0ec94f32-fbb3-4bc0-ba03-cdd8d217c545 at email dot android dot com> <CA+4CFy5D96nJv9WUhiqhzcsc7-xmvirZrWQyTAqEtjj2KQSCVw at mail dot gmail dot com> <6fcfa72b-fb3d-464c-9bce-c4641d498c14 at email dot android dot com> <CA+4CFy6G7veBucfUBc53PG-Mvh8HJihtZMHc+dsX8_QX9WjTAw at mail dot gmail dot com> <CAFiYyc2hkS0tYujcupoxwGdgRSxABcF_2d5r+6N=VsSA7JSxjw at mail dot gmail dot com> <20131122111914 dot GA30986 at kam dot mff dot cuni dot cz> <CAFiYyc2u5z43ioG0QX_9XVeZKBZ3+x9e9YbMZ8GFnGCX07nygw at mail dot gmail dot com>
> >> > 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,