Fixed combo by fixing an old artefact from the older libFirm Cmp nodes.
[libfirm] / ir / stat / firmstat.c
index bf7c7e9..03a4bad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2010 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -25,8 +25,6 @@
  */
 #include "config.h"
 
-#ifdef FIRM_STATISTICS
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -65,12 +63,6 @@ static ir_op _op_DivC;
 /** The Div by Const node. */
 static ir_op _op_ModC;
 
-/** The Div by Const node. */
-static ir_op _op_DivModC;
-
-/** The Quot by Const node. */
-static ir_op _op_QuotC;
-
 /** The memory Proj node. */
 static ir_op _op_ProjM;
 
@@ -593,18 +585,6 @@ static ir_op *stat_get_irn_op(ir_node *node)
                        op = status->op_ModC ? status->op_ModC : op;
                }  /* if */
                break;
-       case iro_DivMod:
-               if (is_Const(get_DivMod_right(node))) {
-                       /* special case, a division/modulo by a const, count on extra counter */
-                       op = status->op_DivModC ? status->op_DivModC : op;
-               }  /* if */
-               break;
-       case iro_Quot:
-               if (is_Const(get_Quot_right(node))) {
-                       /* special case, a floating point division by a const, count on extra counter */
-                       op = status->op_QuotC ? status->op_QuotC : op;
-               }  /* if */
-               break;
        case iro_Sel:
                if (is_Sel(get_Sel_ptr(node))) {
                        /* special case, a Sel of a Sel, count on extra counter */
@@ -937,10 +917,7 @@ static void stat_update_address(ir_node *node, graph_entry_t *graph)
        case iro_Sel:
                base = find_base_adr(node);
                irg = current_ir_graph;
-               if (base == get_irg_tls(irg)) {
-                       /* a TLS variable, like a global. */
-                       cnt_inc(&graph->cnt[gcnt_global_adr]);
-               } else if (base == get_irg_frame(irg)) {
+               if (base == get_irg_frame(irg)) {
                        /* a local Variable. */
                        cnt_inc(&graph->cnt[gcnt_local_adr]);
                } else {
@@ -1113,8 +1090,6 @@ static ir_mode *get_irn_op_mode(ir_node *node)
                return get_Load_mode(node);
        case iro_Store:
                return get_irn_mode(get_Store_value(node));
-       case iro_DivMod:
-               return get_irn_mode(get_DivMod_left(node));
        case iro_Div:
                return get_irn_mode(get_Div_left(node));
        case iro_Mod:
@@ -1454,7 +1429,7 @@ void stat_register_dumper_func(dump_graph_FUNC func)
 /*
  * Helper: get an ir_op from an opcode.
  */
-ir_op *stat_get_op_from_opcode(ir_opcode code)
+ir_op *stat_get_op_from_opcode(unsigned code)
 {
        return opcode_find_entry(code, status->ir_op_hash);
 }  /* stat_get_op_from_opcode */
@@ -2134,7 +2109,7 @@ void stat_dump_snapshot(const char *name, const char *phase)
 {
        char fname[2048];
        const char *p;
-       int l;
+       size_t l;
 
        if (! status->stat_options)
                return;
@@ -2386,20 +2361,12 @@ void firm_init_stat(unsigned enable_options)
                _op_ModC.code    = --num;
                _op_ModC.name    = new_id_from_chars(X("ModC"));
 
-               _op_DivModC.code = --num;
-               _op_DivModC.name = new_id_from_chars(X("DivModC"));
-
-               _op_QuotC.code   = --num;
-               _op_QuotC.name   = new_id_from_chars(X("QuotC"));
-
                status->op_Phi0    = &_op_Phi0;
                status->op_PhiM    = &_op_PhiM;
                status->op_ProjM   = &_op_ProjM;
                status->op_MulC    = &_op_MulC;
                status->op_DivC    = &_op_DivC;
                status->op_ModC    = &_op_ModC;
-               status->op_DivModC = &_op_DivModC;
-               status->op_QuotC   = &_op_QuotC;
        } else {
                status->op_Phi0    = NULL;
                status->op_PhiM    = NULL;
@@ -2407,8 +2374,6 @@ void firm_init_stat(unsigned enable_options)
                status->op_MulC    = NULL;
                status->op_DivC    = NULL;
                status->op_ModC    = NULL;
-               status->op_DivModC = NULL;
-               status->op_QuotC   = NULL;
        }  /* if */
 
        /* for Florian: count the Sel depth */
@@ -2485,16 +2450,3 @@ int stat_is_active(void)
 {
        return status != (stat_info_t *)&status_disable;
 }  /* stat_is_active */
-
-#else
-
-/* initialize the statistics module. */
-void firm_init_stat(unsigned enable_options) {}
-
-/* Dumps a statistics snapshot */
-void stat_dump_snapshot(const char *name, const char *phase) {}
-
-/* terminates the statistics module, frees all memory */
-void stat_term(void);
-
-#endif /* FIRM_STATISTICS */