This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rfc: another switch optimization idea
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Dinar Temirbulatov <dtemirbulatov at gmail dot com>, gcc at gcc dot gnu dot org, Alexey Kravets <Alexey dot Kravets at arm dot com>
- Date: Tue, 26 Mar 2013 10:52:40 +0100
- Subject: Re: rfc: another switch optimization idea
- References: <CAMnfPmPGLpN+Mk_i4sDey2bLJ9qRAE9BgZQb3bSF9sheAfD8Aw at mail dot gmail dot com> <CAFiYyc0kkg17Lh5j7CpPZrOPPxr3xpEW+i2sCwSVDfCEQKLoog at mail dot gmail dot com>
On Tue, Mar 26, 2013 at 10:31 AM, Richard Biener wrote:
> On Mon, Mar 25, 2013 at 10:23 PM, Dinar Temirbulatov wrote:
>> The error in 252.eon was due to incorrect setup. Also "if (count >
>> 3*PARAM_VALUE (PARAM_SWITCH_JUMP_TABLES_BB_OPS_LIMIT))" does not look
>> correct, and probably it is better to move this code in the earlier
>> stage just before the gimple expand and keep preference expand state
>> (jump-tables or not) for every switch statement to avoid dealing with
>> the RTL altogether.
>
> Moving switch "expansion" to GIMPLE is an idea that is around since
> quite some time. Basically you'd lower switches so that remaining
> switch statements directly map to jump-tables only. Steven was working
> on this a bit and if I remember correctly 4.8 has some improvements
> here in the switch-conversion pass.
Right. I will move switch lowering to GIMPLE for GCC 4.9. Everything
not lowered will be expanded as a casesi or tablejump. New methods of
lowering switches can be added in the new GIMPLE lowering pass once
that's done.
Ciao!
Steven