This is the mail archive of the
mailing list for the GCC project.
Re: [patch] stmt.c (emit_case_nodes): Fix optimization/9707.
> In message <Pine.LNX.email@example.com>, Roger S
> ayle writes:
> >On Wed, 24 Mar 2004, Kazu Hirata wrote:
> >> 2004-03-24 Kazu Hirata <firstname.lastname@example.org>
> >> PR optimization/9707.
> >> * stmt.c (emit_case_nodes): Emit equality comparisons instead
> >> of recursing if both children are single-valued cases with no
> >> children.
> >This is OK for mainline.
> >I suspect that tree-ssa may have reorganized the way that switch
> >statements are lowered to RTL, so it would be good to double check
> >this PR once the tree-ssa branch has been merged. In the meantime,
> >this patch looks fine.
> We haven't tackled this problem yet. It's on the list of things we want
> to investigate in the future. There's certainly cases where lowering
> certain switches to a branch decision tree would be good for tree-ssa.
I have kind of plan to do this after tree-profiling branch work is
completted for merging. With the profile in hands we can do much better
work on producing the trees/jumptables, so I intend to create switch
lowering pass that will take current SWITCH_EXPR and turn them into "low
level" ones that will be either jump trees or dense switch_exprs that
will always compile into jumptables.
This shall be pretty straighforward to remove the old switch expansion
code then assuming that we will have CFG and do the lowering at -O0 too.
I do that on tree-profiling branch and it does not seem to slow things
down (the bootstrap is about 3% faster [in some kind of peak it
magically got 8% faster, I plan to investigate why] compared to
tree-ssa, but I don't have any nonoptimizing compilations handy except
for very old results)