On Thu, Jun 30, 2011 at 12:34 AM, Michael Meissner
<meiss...@linux.vnet.ibm.com> wrote:
> On the powerpc, switch statements can be expensive, and we would like to be
> able to tune the threshold of when the compiler generates if statements
> vs. using a table jump operation (and different processors within the powerpc
> have different limits).  This patch adds a powerpc tuning option to control
> this.
>
> I've done bootstraps and make checks with no regressions.  Is this ok to apply
> to the trunk?  At this time, I am not changing the default value (4).  With 
> the
> option, I've seen a few spec 2006 benchmarks run faster, and a few run slower.

Hmm.  This hook looks like it could be turned into a --param.  In fact
it doesn't get whatever context information, so I wonder if any target
does something fancy.

Richard.

> [gcc]
> 2011-06-29  Michael Meissner  <meiss...@linux.vnet.ibm.com>
>
>        * config/rs6000/rs6000.opt (-mcase-values-threshold): New switch.
>
>        * config/rs6000/rs6000.c (TARGET_CASE_VALUES_THRESHOLD): New
>        target hook for override choice of when to do jump table vs. if
>        statements based on -mcase-values-threshold=<n>.
>
>        * doc/invoke.texi (RS/6000 and PowerPC Options): Document
>        -mcase-values-threshold.
>
> [gcc/testsuite]
> 2011-06-29  Michael Meissner  <meiss...@linux.vnet.ibm.com>
>
>        * gcc.target/powerpc/ppc-switch-1.c: New test for
>        -mcase-values-threshold.
>        * gcc.target/powerpc/ppc-switch-2.c: Ditto.
>
> --
> Michael Meissner, IBM
> 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
> meiss...@linux.vnet.ibm.com     fax +1 (978) 399-6899
>

Reply via email to