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;
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
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 */
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
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 */
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
#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)