aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2004-05-28 20:32:20 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-05-28 13:32:20 -0700
commit2fec96c1b922c681881f3a7e524ded5f86ab11c4 (patch)
tree63d46dcc027fefc4d9f02fc56df43d11defc4c12 /gcc/c-common.c
parent45863ba3631b41587cc34ea3f7621bf191f4eb9f (diff)
downloadgcc-2fec96c1b922c681881f3a7e524ded5f86ab11c4.zip
gcc-2fec96c1b922c681881f3a7e524ded5f86ab11c4.tar.gz
gcc-2fec96c1b922c681881f3a7e524ded5f86ab11c4.tar.bz2
c-common.c (c_estimate_num_insns_1): Kill.
2004-05-28 Andrew Pinski <pinskia@physics.uc.edu> * c-common.c (c_estimate_num_insns_1): Kill. (c_estimate_num_insns): Kill. * c-common.h (c_estimate_num_insns): Kill. From-SVN: r82377
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c125
1 files changed, 0 insertions, 125 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 7f1e07a..4aa17e6 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5758,131 +5758,6 @@ resort_sorted_fields (void *obj,
resort_field_decl_cmp);
}
-/* Used by estimate_num_insns. Estimate number of instructions seen
- by given statement. */
-static tree
-c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
-{
- int *count = data;
- tree x = *tp;
-
- if (TYPE_P (x) || DECL_P (x))
- {
- *walk_subtrees = 0;
- return NULL;
- }
- /* Assume that constants and references counts nothing. These should
- be majorized by amount of operations among them we count later
- and are common target of CSE and similar optimizations. */
- if (TREE_CODE_CLASS (TREE_CODE (x)) == 'c'
- || TREE_CODE_CLASS (TREE_CODE (x)) == 'r')
- return NULL;
- switch (TREE_CODE (x))
- {
- /* Recognize assignments of large structures and constructors of
- big arrays. */
- case MODIFY_EXPR:
- case CONSTRUCTOR:
- {
- HOST_WIDE_INT size;
-
- size = int_size_in_bytes (TREE_TYPE (x));
-
- if (size < 0 || size > MOVE_MAX_PIECES * MOVE_RATIO)
- *count += 10;
- else
- *count += ((size + MOVE_MAX_PIECES - 1) / MOVE_MAX_PIECES);
- }
- break;
- case CALL_EXPR:
- {
- tree decl = get_callee_fndecl (x);
-
- if (decl && DECL_BUILT_IN (decl))
- switch (DECL_FUNCTION_CODE (decl))
- {
- case BUILT_IN_CONSTANT_P:
- *walk_subtrees = 0;
- return NULL_TREE;
- case BUILT_IN_EXPECT:
- return NULL_TREE;
- default:
- break;
- }
- *count += 10;
- break;
- }
- /* Few special cases of expensive operations. This is useful
- to avoid inlining on functions having too many of these. */
- case TRUNC_DIV_EXPR:
- case CEIL_DIV_EXPR:
- case FLOOR_DIV_EXPR:
- case ROUND_DIV_EXPR:
- case TRUNC_MOD_EXPR:
- case CEIL_MOD_EXPR:
- case FLOOR_MOD_EXPR:
- case ROUND_MOD_EXPR:
- case RDIV_EXPR:
- *count += 10;
- break;
- /* Various containers that will produce no code themselves. */
- case INIT_EXPR:
- case TARGET_EXPR:
- case BIND_EXPR:
- case BLOCK:
- case TREE_LIST:
- case TREE_VEC:
- case IDENTIFIER_NODE:
- case PLACEHOLDER_EXPR:
- case WITH_CLEANUP_EXPR:
- case CLEANUP_POINT_EXPR:
- case NOP_EXPR:
- case VIEW_CONVERT_EXPR:
- case SAVE_EXPR:
- case UNSAVE_EXPR:
- case COMPLEX_EXPR:
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- case LABEL_EXPR:
- case EXIT_EXPR:
- case LABELED_BLOCK_EXPR:
- case EXIT_BLOCK_EXPR:
-
- case EXPR_STMT:
- case COMPOUND_STMT:
- case RETURN_STMT:
- case LABEL_STMT:
- case SCOPE_STMT:
- case CASE_LABEL:
- case STMT_EXPR:
- case CLEANUP_STMT:
-
- case SIZEOF_EXPR:
- case ARROW_EXPR:
- case ALIGNOF_EXPR:
- break;
- case DECL_STMT:
- /* Do not account static initializers. */
- if (TREE_STATIC (TREE_OPERAND (x, 0)))
- *walk_subtrees = 0;
- break;
- default:
- (*count)++;
- }
- return NULL;
-}
-
-/* Estimate number of instructions that will be created by expanding the body. */
-int
-c_estimate_num_insns (tree decl)
-{
- int num = 0;
- walk_tree_without_duplicates (&DECL_SAVED_TREE (decl), c_estimate_num_insns_1, &num);
- return num;
-}
-
/* Issue the error given by MSGID, indicating that it occurred before
TOKEN, which had the associated VALUE. */