This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/70961] Regrename ignores preferred_rename_class
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 May 2016 21:22:11 +0000
- Subject: [Bug rtl-optimization/70961] Regrename ignores preferred_rename_class
- Auto-submitted: auto-generated
- References: <bug-70961-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70961
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-05-05
CC| |ebotcazou at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> When deciding which register to use regrename.c calls the target function
> preferred_rename_class. However in pass 2 in find_rename_reg it then just
> ignores this preference. This results in significantly increased codesize on
> targets which prefer a subset of allocatable registers in order to use
> smaller instructions.
Pass #2 ignores it since the preference simply couldn't be honored.
> Also the computed super_class appears to be the union of all uses and defs
> instead of the intersection. This should be the intersection as that is the
> set of registers that all uses and defs support.
The super_class has nothing to do with the class that is searched for renaming
registers though, it's just the info passed to the back-end to compute this
class. For example, on the ARM, the preferred_class will be LO_REGS for any
chain of GENERAL_REGS.
> If the preferred class doesn't result in a valid rename then it could search
> a wider class, but then it would need to check that the size of the newly
> selected patterns does not increase.
The size is an arbitrary criterion, this could also be the latency, etc.