On Tue, Mar 20, 2007 at 09:37:38AM -0400, Doug Gregor wrote:
> Even if we only use subcodes for the less often used codes, I think we
> still take the performance hit. The problem is that it's very messy to

I'm sure smaller hit than when going to 9 bit tree code, and on i386/x86_64
maybe even than 16 bit tree code (if I remember well, 8-bit and 32-bit
accesses are usually faster than 16-bit ones).

> deal with a two-level code structure inside, e.g., the C++ front end.
> I did a little experiment with a very rarely used tree code
> (TYPEOF_TYPE), and the results weren't promising:
> 
>  http://gcc.gnu.org/ml/gcc/2007-03/msg00493.html

If you use what has been suggested, i.e.:
#define LANG_TREE_CODE(NODE) (TREE_CODE (NODE) == LANG_CODE ? 
((tree_with_subcode *)(NODE))->subcode : TREE_CODE (NODE))
then it shouldn't be so big.  Everywhere where you don't need >= 256
codes you'd just keep using TREE_CODE, only if e.g. some
switch contains >= 256 FE specific subcodes you'd use LANG_TREE_CODE
instead of TREE_CODE.  GCC would warn you if you forget to use
LANG_TREE_CODE even when it is needed, at least in switches, you'd get
warning: case label value exceeds maximum value for type

        Jakub

Reply via email to