This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Builtins handling in IVOPT
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Wei Mi <wmi at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>, David Li <davidxl at google dot com>
- Date: Fri, 22 Nov 2013 12:12:08 +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>
On Thu, Nov 21, 2013 at 10:36 PM, Wei Mi <firstname.lastname@example.org> wrote:
> On Thu, Nov 21, 2013 at 1:01 PM, Richard Biener
> <email@example.com> wrote:
>> Wei Mi <firstname.lastname@example.org> wrote:
>>>On Thu, Nov 21, 2013 at 11:36 AM, Richard Biener
>>>> Wei Mi <email@example.com> wrote:
>>>>>> So what you are doing is basically not only rewriting memory
>>>>>> to possibly use TARGET_MEM_REF but also address uses to use
>>>>>> &TARGET_MEM_REF. I think this is a good thing in general
>>>>>> (given instructions like x86 lea) and I would not bother
>>>>>> the different kind of uses.
>>>>>You mean to change normal expr to &TMR(expr) form in order to utilize
>>>>>x86 lea type instructions as much as possible. It is interesting. I
>>>>>can experiment that idea later. I am not sure if it could simply
>>>>>My concern is x86 lea still has some limitation (such as three
>>>>>operands lea will have longer latency and can only be issued to
>>>>>port1), if we change some expr to &TMR(expr), will it inhitbit cse
>>>>>opportunity if codegen find out it is not good to use lea?
>>>> That needs to be determined. Over all it might be because ivopts
>>>runs so early. At rtl level there should not be big differences apart
>>>from better initial address computations.
>>>> Did I misunderstand what your patch does?
>>>My patch wants to address the issue that iv uses using as memory
>>>reference actuals for load/store/prefetch builtins are treated as
>>>non-linear iv uses instead of address iv uses, and the result of
>>>determine_use_iv_cost is wrong. After we change those uses to address
>>>uses, less ivs may be used, TMR will be generated for those iv uses
>>>and efficent addressing mode could be utilized.
>> But are not all pointer typed uses address uses?!
> 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.