This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix predict.c (was Re: Convert TREE_CODE_CLASS from letters to enumeration constants)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Jeffrey D. Oldham" <oldham at codesourcery dot com>
- Date: Mon, 20 Sep 2004 12:58:43 -0400
- Subject: [PATCH] Fix predict.c (was Re: Convert TREE_CODE_CLASS from letters to enumeration constants)
- References: <87llf8zp1m.fsf@codesourcery.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 17, 2004 at 12:13:57PM -0700, 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().
Nice.
Seems you missed expr_expected_value in predict.c though.
Commited as obvious.
2004-09-20 Jakub Jelinek <jakub@redhat.com>
* predict.c (expr_expected_value): Use *_CLASS_P macros.
--- gcc/predict.c.jj 2004-09-20 17:35:57.000000000 +0200
+++ gcc/predict.c 2004-09-20 18:50:22.191173276 +0200
@@ -944,8 +944,7 @@ expr_expected_value (tree expr, bitmap v
return TREE_VALUE (TREE_CHAIN (TREE_OPERAND (expr, 1)));
}
}
- if (TREE_CODE_CLASS (TREE_CODE (expr)) == '2'
- || TREE_CODE_CLASS (TREE_CODE (expr)) == '<')
+ if (BINARY_CLASS_P (expr) || COMPARISON_CLASS_P (expr))
{
tree op0, op1, res;
op0 = expr_expected_value (TREE_OPERAND (expr, 0), visited);
@@ -959,7 +958,7 @@ expr_expected_value (tree expr, bitmap v
return res;
return NULL;
}
- if (TREE_CODE_CLASS (TREE_CODE (expr)) == '1')
+ if (UNARY_CLASS_P (expr))
{
tree op0, res;
op0 = expr_expected_value (TREE_OPERAND (expr, 0), visited);
Jakub