This is the mail archive of the
mailing list for the GCC project.
Re: Some questions about pass web
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Carrot Wei <carrot at google dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 3 Sep 2014 15:17:41 +0800
- Subject: Re: Some questions about pass web
- Authentication-results: sourceware.org; auth=none
- References: <CAEe8uECWjpB7LqX_k91Vs2W6jmX4BqwwBmyEcxnmRu8=hmy_vA at mail dot gmail dot com>
On Wed, Sep 3, 2014 at 7:35 AM, Carrot Wei <email@example.com> wrote:
> I have following questions about web (pseudo register renaming) pass:
> 1. It is well known that register renaming is a big help to register
> allocation, but in gcc's backend, the web pass is far before RA, there
> are about 20 passes between them. Does it mean register renaming can
> also heavily benefit other optimizations? And the passes between them
> usually don't generate more register renaming chances?
I think one purpose is to break long dependency chain into short ones.
For example, with below code
i = i + 1;
i = i + 1;
i = i + 1;
Pass fweb could change it into below form
i0 = i + 1
i1 = i0 + 1
i = i0 + 2
Apparently, latter form has shorter chains, which makes df stuff more efficient.
> 2. It looks current web pass can't handle AUTOINC expressions, a reg
> operand is used as both use and def reference in an AUTOINC
> expression, so this def side should not be renamed. Pass web doesn't
> explicitly check this case, may rename the reg operand of AUTOINC
> expression. Is this expected because it is before auto_inc_dec pass?
Last time I tried, there are several passes after loop_done and before
auto-inc-dec can't handle auto-increment addressing mode, including
> 3. Are AUTOINC expressions only generated by auto_inc_dec pass? All
> passes before auto_inc_dec including expand should not generate
> AUTOINC expressions, otherwise it will break web.
Yes. Yet other passes may generate auto-inc friendly instruction
patterns thus auto-inc-dec can capture more opportunities. IVOPT is a
> Could anybody help to answer these questions?
> thanks a lot
> Guozhi Wei