Loop inversion does not fail the given test cases but is still 'dumb'.
[libfirm] / ir / opt / gvn_pre.c
index 6ffe65c..a91b703 100644 (file)
@@ -23,7 +23,7 @@
  *          (VanDrunen Hosking 2004)
  * @author  Michael Beck
  * @version $Id$
- * @summary
+ * @brief
  */
 #include "config.h"
 
 #include "iredges.h"
 #include "iropt_dbg.h"
 #include "debug.h"
+#include "irpass.h"
 
 #include "irgraph_t.h"
 #include "irnode_t.h"
 #include "iropt_t.h"
-#include "irtools.h"
 
 /** Additional info we need for every block. */
 typedef struct block_info {
@@ -75,7 +75,7 @@ typedef struct pre_env {
        struct obstack *obst;   /**< The obstack to allocate on. */
        ir_node *start_block;   /**< The start block of the current graph. */
        ir_node *end_block;     /**< The end block of the current graph */
-       block_info *list;       /**< Links all block info entires for easier recovery. */
+       block_info *list;       /**< Links all block info entries for easier recovery. */
        elim_pair *pairs;       /**< A list of node pairs that must be eliminated. */
        unsigned last_idx;      /**< last node index of "old" nodes, all higher indexes are newly created once. */
        char changes;           /**< Non-zero, if calculation of Antic_in has changed. */
@@ -160,7 +160,7 @@ static block_info *get_block_info(ir_node *block) {
  * @param env     the environment
  */
 static void alloc_blk_info(ir_node *block, pre_env *env) {
-       block_info *info = obstack_alloc(env->obst, sizeof(*info));
+       block_info *info = OALLOC(env->obst, block_info);
 
        set_irn_link(block, info);
        info->exp_gen   = ir_valueset_new(16);
@@ -719,7 +719,7 @@ static void eliminate(ir_node *irn, void *ctx) {
                        ir_node *expr = ir_valueset_lookup(bl->avail_out, value);
 
                        if (expr != NULL && expr != irn) {
-                               elim_pair *p = obstack_alloc(env->obst, sizeof(*p));
+                               elim_pair *p = OALLOC(env->obst, elim_pair);
 
                                p->old_node = irn;
                                p->new_node = expr;
@@ -780,7 +780,7 @@ static void eliminate_nodes(elim_pair *pairs) {
  * references the origin. These nodes are translated again and again...
  *
  * The current fix is to use post-dominance. This simple ignores
- * endless loops, ie we cannot optimize them.
+ * endless loops, i.e. we cannot optimize them.
  */
 void do_gvn_pre(ir_graph *irg)
 {
@@ -897,7 +897,7 @@ void do_gvn_pre(ir_graph *irg)
 }  /* do_gvn_pre */
 
 /* Creates an ir_graph pass for do_gvn_pre. */
-ir_graph_pass_t *do_gvn_pre_pass(const char *name, int verify, int dump)
+ir_graph_pass_t *do_gvn_pre_pass(const char *name)
 {
-       return def_graph_pass(name ? name : "gvn_pre", verify, dump, do_gvn_pre);
+       return def_graph_pass(name ? name : "gvn_pre", do_gvn_pre);
 }  /* do_gvn_pre_pass */