This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Propagate profile counts after switch case expansion (issue5896043)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Easwaran Raman <eraman at google dot com>
- Cc: reply at codereview dot appspotmail dot com, gcc-patches at gcc dot gnu dot org
- Date: Sun, 25 Mar 2012 21:22:20 +0200
- Subject: Re: Propagate profile counts after switch case expansion (issue5896043)
- References: <20120323174310.64276220E1C@agni2.mtv.corp.google.com>
> This patch propagates execution count of thee case labels of a
> switch-case statement after its expansion. Bootstraps and all
> tests pass. OK for trunk?
Hi,
while this is resonable thing to do, I belive it would make most sense
to make switch lowering at gimple level: i.e. reorganize the existing
code to produce gimple statement and change expansion code to produce
tablejump from every gimple switch statement that was left in the
code.
This would be both cleaner and would allow gimple optimizers to improve the
generated code. Incrementally it would also allow us to improve switch exansion
that is quite baroque and not realy producing very good code in some common
cases.
If you would be interested working on this (i.e. reorganizing the expansion
code to produce gimple), I would be very happy. If not, I can review the
profile updating part for mainline, since in any case this is desriable thing
to do.
Honza