added data and functions for post-dominance info
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 9 Jan 2006 11:36:05 +0000 (11:36 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 9 Jan 2006 11:36:05 +0000 (11:36 +0000)
[r7204]

ir/ir/irgraph.c
ir/ir/irgraph.h
ir/ir/irgraph_t.h

index b7235bd..9237954 100644 (file)
@@ -184,6 +184,7 @@ new_r_ir_graph (entity *ent, int n_loc)
   res->irg_pinned_state    = op_pin_state_pinned;
   res->outs_state          = outs_none;
   res->dom_state           = dom_none;
+  res->pdom_state          = dom_none;
   res->typeinfo_state      = ir_typeinfo_none;
   set_irp_typeinfo_inconsistent();           /* there is a new graph with typeinfo_none. */
   res->callee_info_state   = irg_callee_info_none;
@@ -622,9 +623,14 @@ irg_dom_state
   return _get_irg_dom_state(irg);
 }
 
+irg_dom_state
+(get_irg_postdom_state)(const ir_graph *irg) {
+  return _get_irg_postdom_state(irg);
+}
+
 void
-(set_irg_dom_inconsistent)(ir_graph *irg) {
-  _set_irg_dom_inconsistent(irg);
+(set_irg_doms_inconsistent)(ir_graph *irg) {
+  _set_irg_doms_inconsistent(irg);
 }
 
 irg_loopinfo_state
index 742ed6c..32905bc 100644 (file)
@@ -318,7 +318,7 @@ irg_outs_state get_irg_outs_state(const ir_graph *irg);
 void           set_irg_outs_inconsistent(ir_graph *irg);
 
 /** state: dom_state
- * Signals the state of the dominator information.
+ * Signals the state of the dominator / post dominator information.
  */
 typedef enum {
   dom_none,             /**< dominator are not computed, no memory is allocated */
@@ -326,11 +326,14 @@ typedef enum {
   dom_inconsistent      /**< dominator information is computed but the graph has been changed since */
 } irg_dom_state;
 
-/** returns the dom_state of an IR graph. */
+/** returns the dominator state of an IR graph. */
 irg_dom_state get_irg_dom_state(const ir_graph *irg);
 
-/** sets the dom_state of an IR graph. */
-void set_irg_dom_inconsistent(ir_graph *irg);
+/** returns the post dominator state of an IR graph. */
+irg_dom_state get_irg_postdom_state(const ir_graph *irg);
+
+/** sets the dominator and post dominator state of an IR graph to inconsistent. */
+void set_irg_doms_inconsistent(ir_graph *irg);
 
 /** state: loopinfo_state
  *  Loop information describes the loops within the control and
index ef3b38f..9e425f2 100644 (file)
@@ -92,7 +92,8 @@ struct ir_graph {
   irg_phase_state phase_state;       /**< compiler phase */
   op_pin_state irg_pinned_state;     /**< Flag for status of nodes */
   irg_outs_state outs_state;         /**< Out edges. */
-  irg_dom_state dom_state;           /**< Dominator information */
+  irg_dom_state dom_state;           /**< Dominator state information */
+  irg_dom_state pdom_state;          /**< Post Dominator state information */
   ir_typeinfo_state typeinfo_state;        /**< Validity of type information */
   irg_callee_info_state callee_info_state; /**< Validity of callee information */
   irg_loopinfo_state loopinfo_state;       /**< state of loop information */
@@ -396,9 +397,17 @@ _get_irg_dom_state(const ir_graph *irg) {
   return irg->dom_state;
 }
 
+static INLINE irg_dom_state
+_get_irg_postdom_state(const ir_graph *irg) {
+  return irg->pdom_state;
+}
+
 static INLINE void
-_set_irg_dom_inconsistent(ir_graph *irg) {
-  irg->dom_state = dom_inconsistent;
+_set_irg_doms_inconsistent(ir_graph *irg) {
+  if (irg->dom_state != dom_none)
+    irg->dom_state = dom_inconsistent;
+  if (irg->pdom_state != dom_none)
+    irg->pdom_state = dom_inconsistent;
 }
 
 static INLINE irg_loopinfo_state
@@ -545,7 +554,8 @@ _get_irg_estimated_node_cnt(const ir_graph *irg) {
 #define get_irg_outs_state(irg)               _get_irg_outs_state(irg)
 #define set_irg_outs_inconsistent(irg)        _set_irg_outs_inconsistent(irg)
 #define get_irg_dom_state(irg)                _get_irg_dom_state(irg)
-#define set_irg_dom_inconsistent(irg)         _set_irg_dom_inconsistent(irg)
+#define get_irg_postdom_state(irg)            _get_irg_postdom_state(irg)
+#define set_irg_doms_inconsistent(irg)        _set_irg_doms_inconsistent(irg)
 #define get_irg_loopinfo_state(irg)           _get_irg_loopinfo_state(irg)
 #define set_irg_loopinfo_state(irg, s)        _set_irg_loopinfo_state(irg, s)
 #define set_irg_loopinfo_inconsistent(irg)    _set_irg_loopinfo_inconsistent(irg)