This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Switch stmts and inserting on edge
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: Diego Novillo <dnovillo at redhat dot com>, Andrew Macleod<amacleod at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 31 May 2003 23:41:08 -0700
- Subject: Re: [tree-ssa] Switch stmts and inserting on edge
- References: <Pine.LNX.4.44.0305301411440.11492-100000@nondot.org>
Chris Lattner <sabre@nondot.org> writes:
> In LLVM it's straight-forward to write target-independent transformations
> that use information about the target. In this case we could expose
> things like how sparse the switch needs to be before we break it up into a
> binary tree. Also you can use profile information to make the hot paths
> shorter, and other optimizations...
There's a whole portfolio of target-independent transformations that
it would be nice to see done on SWITCH_EXPRs at the tree level. For
instance, there's no good reason why the code generated for a plain
old switch on an opcode number should be different from the code you
get if you use the computed goto extension. For another, it would be
nifty if a switch statement every branch of which set the same
variable to a different value got turned into a single assignment to
that variable from a lookup table.
zw