For the relation between web and AUTOINC, I found the code in union_defs: if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE) { ... }
So web should handle AUTOINC in theory, but in an experiment, I added a second web pass just before RA, web generated wrong code in the presence of AUTOINC expressions. I will debug it more. thanks Guozhi Wei On Tue, Sep 2, 2014 at 4:35 PM, Carrot Wei <car...@google.com> wrote: > Hi > > 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? > > 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? > > 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. > > Could anybody help to answer these questions? > > thanks a lot > Guozhi Wei