[patch] Move lowering of switches to bit tests to GIMPLE

Steven Bosscher stevenb.gcc@gmail.com
Sat Jun 30 17:03:00 GMT 2012


Hello,

This patch moves the emit_case_bit_tests method of switch lowering
from 'expand' to a GIMPLE pass.

Initially, I planned to move all switch lowering to something other
than a casesi or tablejump to GIMPLE, but this is more involved than I
anticipated. My plan was (and still is, but for later) to do the
switch lowering using a divide-and-conquer approach: Parts of a switch
may be best expanded as bit-tests, other parts maybe as a decision
tree, and yet others as casesi/tablejump (the code in stmt.c uses only
one of these approaches per GIMPLE_SWITCH). Also I wanted to use
profile information in the lowering decision making (using Freescale's
patch as a basis). But I need to come up with a way to handle the SJLJ
dispatch table issue.

I'll continue to work on all of the above, and I hope I can finish
everything I planned to work on for GCC 4.8.
But to make sure I don't miss the GCC 4.8 stage1 deadline, I'm
proposing this for trunk now.

Bootstrapped&tested on powerpc64-unknown-linux-gnu - several times in
fact, over the past few months.
Bootstrapped&tested on x86_64-unknown-linux-gnu. Also built&tested on
various powerpc64 X embedded targets.

OK for trunk?

Ciao!
Steven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: move_switch_as_case_bit_tests_to_GIMPLE.diff
Type: application/octet-stream
Size: 28118 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120630/ee295dd2/attachment.obj>


More information about the Gcc-patches mailing list