add an is_Quot function
[libfirm] / ir / opt / strength_red.c
index a2155cf..0d23520 100644 (file)
@@ -12,6 +12,9 @@
  * Copyright:   (c) 2004 Universität Karlsruhe
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 # include "strength_red.h"
 
@@ -35,10 +38,10 @@ static int n_made_new_phis;
  * @verbatim
  *
  *       init
- *       /|\
+ *        ^
  *        |
  *   +-- Phi
- *   |   /|\
+ *   |    ^
  *   |    |
  *   +-->op
  *
@@ -565,12 +568,13 @@ static void reduce_itervar(ir_node *itervar_phi, void *env)
   /* check if a iteration variable be reduced.*/
   int reduced = 0;
 
-  if (get_irn_op(itervar_phi) != op_Phi)
+  if (! is_Phi(itervar_phi))
     return;
-  /* A candidate is found.*/
+
+  /* A potential candidate is found.*/
   ivi.itervar_phi = itervar_phi;
 
-  /* It musss be a induction variable.*/
+  /* check if it's a induction variable.*/
   if (is_induction_variable(&ivi)) {
     int i, op_out;
 
@@ -664,9 +668,9 @@ void reduce_strength(ir_graph *irg) {
   /* Call algorithm that computes the backedges */
   construct_cf_backedges(irg);
   /* Call algorithm that computes the dominator trees. */
-  compute_doms(irg);
+  assure_doms(irg);
   /* Call algorithm that computes the out edges */
-  compute_irg_outs(irg);
+  assure_irg_outs(irg);
 
   /* -- Search expressions that can be optimized -- */
   irg_walk_graph(irg, NULL, reduce_itervar, NULL);