bugfix, removed dead code
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Fri, 12 Nov 2004 15:24:31 +0000 (15:24 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Fri, 12 Nov 2004 15:24:31 +0000 (15:24 +0000)
[r4398]

ir/ana/Makefile.in
ir/ana/field_temperature.c
ir/ana/field_temperature.h

index 44a0379..e0d96ab 100644 (file)
@@ -16,15 +16,16 @@ topdir = ../..
 subdir := ir/ana
 
 INSTALL_HEADERS = irouts.h trouts.h irdom.h cgana.h irloop.h irtypeinfo.h irsimpletype.h  \
-               callgraph.h field_temperature.h rta.h
+               callgraph.h rta.h interval_analysis.h                                   \
+               field_temperature.h execution_frequency.h
 
 SOURCES = $(INSTALL_HEADERS)
 
 SOURCES += Makefile.in \
                irouts.c trouts.c irdom_t.h irdom.c cgana.c     rta.c  \
                irloop_t.h irbackedge.c irbackedge_t.h irscc.c ircfscc.c        \
-               irtypeinfo.c irsimpletype.c                                     \
-               callgraph.c field_temperature.c
+               irtypeinfo.c irsimpletype.c interval_analysis.c                 \
+               callgraph.c field_temperature.c execution_frequency.c
 
 include $(topdir)/MakeRules
 
index 8e09975..1c213cf 100644 (file)
 /* initialize, global variables.                                               */
 /* *************************************************************************** */
 
-/* A list of Load and Store operations that have no analyseable address. */
-static ir_node **unrecognized_access = NULL;
-
-static void add_unrecognized_access(ir_node *n) {
-  ARR_APP1(ir_node *, unrecognized_access, n);
-}
-
 
 /* *************************************************************************** */
 /*   Access routines for irnodes                                               */
@@ -45,51 +38,11 @@ entity *get_Sel_accessed_entity(ir_node *sel, int pos) {
   return get_Sel_entity(sel);
 }
 
-/* An addr node is a SymConst or a Sel. */
-int get_addr_n_entities(ir_node *addr) {
-  int n_ents;
-
-  switch (get_irn_opcode(addr)) {
-  case iro_Sel:
-    /* Treat jack array sels? */
-    n_ents = get_Sel_n_accessed_entities(addr);
-    break;
-  case iro_SymConst:
-    if (get_SymConst_kind(addr) == symconst_addr_ent) {
-      n_ents = 1;
-      break;
-    }
-  default:
-    //assert(0 && "unexpected address expression");
-    n_ents = 0;
-  }
-
-  return n_ents;
-}
 
-/* An addr node is a SymConst or a Sel. */
-entity *get_addr_entity(ir_node *addr, int pos) {
-  entity *ent;
-
-  switch (get_irn_opcode(addr)) {
-  case iro_Sel:
-    /* Treat jack array sels? */
-    assert (0 <= pos && pos < get_Sel_n_accessed_entities(addr));
-    ent = get_Sel_accessed_entity(addr, pos);
-    break;
-  case iro_SymConst:
-    if (get_SymConst_kind(addr) == symconst_addr_ent) {
-      assert(pos == 0);
-      ent = get_SymConst_entity(addr);
-      break;
-    }
-  default:
-    ent = NULL;
-  }
-
-  return ent;
-}
 
+/* *************************************************************************** */
+/* The heuristic                                                               */
+/* *************************************************************************** */
 
 int get_irn_loop_call_depth(ir_node *n) {
   ir_graph *irg = get_irn_irg(n);
@@ -106,10 +59,6 @@ int get_irn_recursion_depth(ir_node *n) {
 }
 
 
-/* *************************************************************************** */
-/* The heuristic                                                               */
-/* *************************************************************************** */
-
 int get_weighted_loop_depth(ir_node *n) {
   int loop_call_depth = get_irn_loop_call_depth(n);
   int loop_depth      = get_irn_loop_depth(n);
@@ -118,66 +67,6 @@ int get_weighted_loop_depth(ir_node *n) {
   return loop_call_depth + loop_depth + recursion_depth;
 }
 
-/* *************************************************************************** */
-/* The analyses                                                                */
-/* *************************************************************************** */
-
-static void init_field_temperature(void) {
-  assert(!unrecognized_access);
-  unrecognized_access = NEW_ARR_F(ir_node *, 0);
-}
-
-
-static void chain_accesses(ir_node *n, void *env) {
-  int i, n_ents;
-  ir_node *addr;
-
-  if (get_irn_op(n) == op_Alloc) {
-    add_type_allocation(get_Alloc_type(n), n);
-    return;
-  }
-
-  if (is_memop(n)) {
-    addr = get_memop_ptr(n);
-  } else if (get_irn_op(n) == op_Call) {
-    addr = get_Call_ptr(n);
-    if (get_irn_op(addr) != op_Sel) return;  /* Sels before Calls mean a Load / polymorphic Call. */
-  } else {
-    return;
-  }
-
-  n_ents = get_addr_n_entities(addr);
-  for (i = 0; i < n_ents; ++i) {
-    entity *ent = get_addr_entity(addr, i);
-    if (ent)
-      add_entity_access(ent, n);
-    else
-      add_unrecognized_access(n);
-  }
-}
-
-
-/* compute the field temperature. */
-void compute_field_temperature(void) {
-
-  int i, n_irgs = get_irp_n_irgs();
-
-  init_field_temperature();
-
-  for (i=0; i < n_irgs; i++) {
-    current_ir_graph = get_irp_irg(i);
-    irg_walk_graph(current_ir_graph, NULL, chain_accesses, NULL);
-  }
-}
-
-/* free occupied memory, reset */
-void free_field_temperature(void) {
-  DEL_ARR_F(unrecognized_access);
-  unrecognized_access = NULL;
-}
-
-
-
 /* *************************************************************************** */
 /* Auxiliary                                                                   */
 /* *************************************************************************** */
@@ -187,8 +76,8 @@ int is_jack_rts_class(type *t) {
   ident *name = get_type_ident(t);
 
   if (id_is_prefix(new_id_from_str("java/"), name)) return 1;
-  if (id_is_prefix(new_id_from_str("["), name)) return 1;
-  if (id_is_prefix(new_id_from_str("gnu/"), name)) return 1;
+  if (id_is_prefix(new_id_from_str("["), name))     return 1;
+  if (id_is_prefix(new_id_from_str("gnu/"), name))  return 1;
   if (id_is_prefix(new_id_from_str("java/"), name)) return 1;
 
   return 0;
index 06127d8..c4a288c 100644 (file)
 /**
  * @file field_temperature.h
  *
+ *  @author Goetz Lindenmaier
+ *
  *  Watch it! This is highly java dependent.
  *
  * - All Sel nodes get an array with possibly accessed entities.
  *   (resolve polymorphy on base of inherited entities.)
  *   (the mentioned entity in first approximation.)
  *
- * - Each entity gets all SymConst/Sel nodes, that reference the
- *   entity (Sel: references as accessed entity.)
- *
  * - We compute a value for the entity based on the Sel nodes.
  */
 
 
 
 
-/** The entities that can be accessed by this Sel node. */
+/** The entities that can be accessed by this Sel node. *
 int     get_Sel_n_accessed_entities(ir_node *sel);
 entity *get_Sel_accessed_entity    (ir_node *sel, int pos);
-
+*/
 
 
 /** Get the weighted interprocedural loop depth of the node.
@@ -46,14 +45,6 @@ int get_weighted_loop_depth(ir_node *n);
 
 
 
-/** compute the field temperature. */
-void compute_field_temperature(void);
-
-/** free occupied memory, reset */
-void free_field_temperature(void);
-
-
-
 
 
 /** An auxiliary/temporary function */