access routines for memops,
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Fri, 3 Sep 2004 08:08:03 +0000 (08:08 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Fri, 3 Sep 2004 08:08:03 +0000 (08:08 +0000)
fixed header for firmjni
dump analyses info

[r3820]

ir/ir/irdump.h
ir/ir/irdumptxt.c
ir/ir/irnode.c
ir/ir/irnode.h

index 21dc4dc..08aaac4 100644 (file)
@@ -263,7 +263,7 @@ void dump_callgraph_loop_tree(const char *suffix);
 
 /** Verbosity for text dumpers */
 typedef enum {
-  dump_verbosity_onlynames         = 0x00000001,   /**< only dump type names. turns off all other
+  dump_verbosity_onlynames         = 0x00000001,   /**< only dump names. turns off all other
                                                      flags up to 0x00010000. */
   dump_verbosity_fields            = 0x00000002,   /**< dump types and fields (like a type declaration) */
   dump_verbosity_methods           = 0x00000004,   /**< dump types and methods (like a type declaration) */
@@ -271,6 +271,8 @@ typedef enum {
   dump_verbosity_entattrs          = 0x00000010,   /**< dump all entity attributes */
   dump_verbosity_entconsts         = 0x00000020,   /**< dump entity constants */
 
+  dump_verbosity_accessStats       = 0x00000100,   /**< dump entity access statistics */
+
   dump_verbosity_noClassTypes      = 0x00001000,   /**< dump no class       types */
   dump_verbosity_noStructTypes     = 0x00002000,   /**< dump no struct      types */
   dump_verbosity_noUnionTypes      = 0x00004000,   /**< dump no union       types */
@@ -289,7 +291,7 @@ typedef enum {
   dump_verbosity_onlyPrimitiveTypes = 0x000BF000,  /**< dump only primitive types */
   dump_verbosity_onlyEnumerationTypes=0x0008F000,  /**< dump only enumeration types */
 
-  dump_verbosity_max               = 0x48888887,   /**< turn on all verbosity. */
+  dump_verbosity_max               = 0x48888887    /**< turn on all verbosity. */
 } dump_verbosity;
 
 
index 39be89f..ce931a8 100644 (file)
@@ -22,6 +22,8 @@
 #include "irprog_t.h"
 #include "entity_t.h"
 
+#include "field_temperature.h"
+
 int dump_node_opcode(FILE *F, ir_node *n); /* from irdump.c */
 
 
@@ -89,10 +91,19 @@ void    dump_entity_to_file_prefix (FILE *F, entity *ent, char *prefix, unsigned
       X(variability_constant);
     }
     fprintf(F, "\n");
-  } else {  /* no entityattrs */
+  } else {  /* no entattrs */
     fprintf(F, "%s(%3d) %*s: %s", prefix,
            get_entity_offset_bits(ent), -40, get_type_name(get_entity_type(ent)), get_entity_name(ent));
     if (is_method_type(get_entity_type(ent))) fprintf(F, "(...)");
+
+    if (verbosity & dump_verbosity_accessStats) {
+      if (get_entity_allocation(ent) == allocation_static) {
+       fprintf(F, " (stat)");
+      } else {
+       if (get_entity_peculiarity(ent) == peculiarity_description) fprintf(F, " (desc)");
+       if (get_entity_peculiarity(ent) == peculiarity_inherited)   fprintf(F, " (inh)");
+      }
+    }
     fprintf(F, "\n");
   }
 
@@ -148,6 +159,27 @@ void    dump_entity_to_file_prefix (FILE *F, entity *ent, char *prefix, unsigned
     }
     fprintf(F, "\n");
   }
+
+  if (verbosity & dump_verbosity_accessStats) {
+    int n_acc = get_entity_n_accesses(ent);
+    fprintf(F, "%s  Access Stats", prefix);
+    char comma = ':';
+    for (i = 0; i < n_acc; ++i) {
+      ir_node *acc = get_entity_access(ent, i);
+      if (get_irn_op(acc) == op_Load) {
+       fprintf(F, "%c L", comma);
+      } else if (get_irn_op(acc) == op_Store) {
+       fprintf(F, "%c S", comma);
+      } else {
+       assert(0);
+      }
+      fprintf(F, " %d", get_weighted_loop_depth(acc));
+      comma = ',';
+    }
+    fprintf(F, "\n");
+  }
+
+
 }
 #undef X
 
@@ -287,6 +319,9 @@ void dump_types_as_text(unsigned verbosity, const char *suffix) {
 
   for (i = 0; i < n_types; ++i) {
     type *t = get_irp_type(i);
+
+    if (is_jack_rts_class(t)) continue;
+
     dump_type_to_file(F, t, verbosity);
   }
 
index 535e356..08bd78e 100644 (file)
@@ -1498,6 +1498,31 @@ set_Phi_pred (ir_node *node, int pos, ir_node *pred) {
   set_irn_n(node, pos, pred);
 }
 
+
+int is_memop(ir_node *node) {
+  return ((get_irn_op(node) == op_Load) || (get_irn_op(node) == op_Load));
+}
+
+ir_node *get_memop_mem (ir_node *node) {
+  assert(is_memop(node));
+  return get_irn_n(node, 0);
+}
+
+void     set_memop_mem (ir_node *node, ir_node *mem) {
+  assert(is_memop(node));
+  set_irn_n(node, 0, mem);
+}
+
+ir_node *get_memop_ptr (ir_node *node) {
+  assert(is_memop(node));
+  return get_irn_n(node, 1);
+}
+
+void     set_memop_ptr (ir_node *node, ir_node *ptr) {
+  assert(is_memop(node));
+  set_irn_n(node, 1, ptr);
+}
+
 ir_node *
 get_Load_mem (ir_node *node) {
   assert (node->op == op_Load);
index 252b225..10840a0 100644 (file)
@@ -719,6 +719,17 @@ void     set_Filter_cg_pred(ir_node * node, int pos, ir_node * pred);
 int      get_Filter_n_cg_preds(ir_node *node);
 ir_node *get_Filter_cg_pred(ir_node *node, int pos);
 
+/** Return true if parameter is a memory operation.
+ *
+ *  A memory operation is an operation that directly changes the
+ *  memory.  I.e., a Load or a Store operation.
+ */
+int is_memop(ir_node *node);
+ir_node *get_memop_mem (ir_node *node);
+void     set_memop_mem (ir_node *node, ir_node *mem);
+ir_node *get_memop_ptr (ir_node *node);
+void     set_memop_ptr (ir_node *node, ir_node *ptr);
+
 /**
  * Projection numbers for Load: use for Proj nodes!
  */