added function reinit all irn data belonging to a certain block
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Tue, 24 Oct 2006 12:14:21 +0000 (12:14 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Tue, 24 Oct 2006 12:14:21 +0000 (12:14 +0000)
made reinit_single_irn_data INLINE

[r8364]

ir/ir/irphase.c
ir/ir/irphase_t.h

index e934a30..4879a97 100644 (file)
@@ -71,16 +71,20 @@ void phase_reinit_irn_data(phase_t *phase)
        }
 }
 
-void phase_reinit_single_irn_data(phase_t *phase, ir_node *irn)
+void phase_reinit_block_irn_data(phase_t *phase, ir_node *block)
 {
-       int idx;
+       int i, n;
 
        if (! phase->data_init)
                return;
 
-       idx = get_irn_idx(irn);
-       if (phase->data_ptr[idx])
-               phase->data_init(phase, irn, phase->data_ptr[idx]);
+       for (i = 0, n = phase->n_data_ptr; i < n; ++i) {
+               if (phase->data_ptr[i]) {
+                       ir_node *irn = get_idx_irn(phase->irg, i);
+                       if (! is_Block(irn) && get_nodes_block(irn) == block)
+                               phase->data_init(phase, irn, phase->data_ptr[i]);
+               }
+       }
 }
 
 ir_node *phase_get_first_node(phase_t *phase) {
index ae30de2..3d9920e 100644 (file)
@@ -78,12 +78,19 @@ void phase_free(phase_t *phase);
  */
 void phase_reinit_irn_data(phase_t *phase);
 
+/**
+ * Re-initialize the irn data for all nodes in the given block.
+ * @param phase The phase.
+ * @param block The block.
+ */
+void phase_reinit_block_irn_data(phase_t *phase, ir_node *block);
+
 /**
  * Re-initialize the irn data for the given node.
  * @param phase The phase.
  * @param irn   The irn.
  */
-void phase_reinit_single_irn_data(phase_t *phase, ir_node *irn);
+#define phase_reinit_single_irn_data(phase, irn) _phase_reinit_single_irn_data((phase), (irn))
 
 /**
  * Returns the first node of the phase having some data assigned.
@@ -157,6 +164,22 @@ ir_node *phase_get_next_node(phase_t *phase, ir_node *start);
  */
 #define phase_set_irn_data(ph, irn, data)  _phase_set_irn_data((ph), (irn), (data))
 
+/**
+ * This is private and only here for performance reasons.
+ */
+static INLINE void _phase_reinit_single_irn_data(phase_t *phase, ir_node *irn)
+{
+       int idx;
+
+       if (! phase->data_init)
+               return;
+
+       idx = get_irn_idx(irn);
+       if (phase->data_ptr[idx])
+               phase->data_init(phase, irn, phase->data_ptr[idx]);
+}
+
+
 /**
  * This is private and just here for performance reasons.
  */