This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Convert TREE_CODE_CLASS from letters to enumeration constants



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]