Convert TREE_CODE_CLASS from letters to enumeration constants

Andrew Pinski pinskia@physics.uc.edu
Fri Sep 17 21:37:00 GMT 2004


On Sep 17, 2004, at 12:13 PM, Zack Weinberg wrote:

>
> This patch converts all TREE_CODE_CLASS values from character
> constants to enumeration constants.  This is good for an approximately
> 1.5% speedup building Qt at -g -O0 -- mostly, I believe, because
> IS_EXPR_CODE_CLASS is now two numeric comparisons instead of a call to
> strchr().
>
> The patch was inspired by Paolo Bonzini's earlier, similar change to
> RTL classes.  Most of the work was done by Jeffrey Oldham.  I audited
> his work and changed some drop-through switch defaults to aborts.
>
> Bootstrapped i686-linux (all languages except gfortran, which I cannot
> build due to lacking GMP+MPFR) and powerpc-darwin (C, C++ only; both
> with and without checking).  Mark has, offline, approved this despite
> being in stage 3, but I will wait a few hours for comments before
> checking it in.
>
> I am aware of a few minor nits in this code (non-orthogonality of the
> query macros, tree_code_class_strings not being declared right) but I
> would prefer to fix those in followup patches, as this patch is
> already far too big and unwieldy.


All I have to say is sweeeeeet. I know that Steven B. had a patch
to do this but it did not show any different in compile time on x86
but he gave the patch to me and I had meant to test it on 
powerpc-darwin.
I did not find the time to test it so he/I never got around to
submitting the patch.

Thanks,
Andrew Pinski



More information about the Gcc-patches mailing list