Create clean register requirements for Phis, otherwise reg_reqs_equal() and maybe...
[libfirm] / ir / opt / jumpthreading.c
index e2e4866..02ca3bf 100644 (file)
@@ -44,6 +44,7 @@
 #include "tv.h"
 #include "opt_confirms.h"
 #include "iropt_dbg.h"
+#include "irpass.h"
 
 #undef AVOID_PHIB
 
@@ -430,7 +431,7 @@ static ir_node *find_const_or_confirm(jumpthreading_env_t *env, ir_node *jump,
 
                DB((
                        dbg, LEVEL_1,
-                       "> Found condition evaluation candidate %+F->%+F\n",
+                       "> Found jump threading candidate %+F->%+F\n",
                        env->true_block, block
                ));
 
@@ -496,7 +497,7 @@ static ir_node *find_candidate(jumpthreading_env_t *env, ir_node *jump,
 
                DB((
                        dbg, LEVEL_1,
-                       "> Found condition evaluation candidate %+F->%+F\n",
+                       "> Found jump threading candidate %+F->%+F\n",
                        env->true_block, block
                ));
 
@@ -671,7 +672,7 @@ static void thread_jumps(ir_node* block, void* data)
        } else if (selector_evaluated == 1) {
                dbg_info *dbgi = get_irn_dbg_info(selector);
                ir_node  *jmp  = new_rd_Jmp(dbgi, get_nodes_block(projx));
-               DBG_OPT_COND_EVAL(projx, jmp);
+               DBG_OPT_JUMPTHREADING(projx, jmp);
                exchange(projx, jmp);
                *changed = 1;
                return;
@@ -741,3 +742,9 @@ void opt_jumpthreading(ir_graph* irg)
                optimize_cf(irg);
        }
 }
+
+/* Creates an ir_graph pass for opt_jumpthreading. */
+ir_graph_pass_t *opt_jumpthreading_pass(const char *name)
+{
+       return def_graph_pass(name ? name : "jumpthreading", opt_jumpthreading);
+}  /* opt_jumpthreading_pass */