cmov with unknowns are pointless
[libfirm] / ir / opt / convopt.c
index b775570..ef7c5d6 100644 (file)
@@ -40,8 +40,9 @@
 #include "config.h"
 #endif
 
+#include "iroptimize.h"
+
 #include <assert.h>
-#include "convopt.h"
 #include "debug.h"
 #include "ircons.h"
 #include "irgmod.h"
@@ -164,8 +165,8 @@ int is_downconv(ir_mode *src_mode, ir_mode *dest_mode)
                get_mode_size_bits(dest_mode) < get_mode_size_bits(src_mode);
 }
 
-/* TODO, backends can't handle and it's probably not more efficient on most
-   archs */
+/* TODO, backends (at least ia23) can't handle it at the moment,
+   and it's probably not more efficient on most archs */
 #if 0
 static
 void try_optimize_cmp(ir_node *node)
@@ -188,6 +189,7 @@ void conv_opt_walker(ir_node *node, void *data)
        ir_mode *pred_mode;
        ir_mode *mode;
        int costs;
+       (void) data;
 
 #if 0
        if(is_Cmp(node)) {
@@ -218,6 +220,7 @@ void conv_opt_walker(ir_node *node, void *data)
 
 void conv_opt(ir_graph *irg)
 {
+       char invalidate = 0;
        FIRM_DBG_REGISTER(dbg, "firm.opt.conv");
 
        DB((dbg, LEVEL_1, "===> Performing conversion optimization on %+F\n", irg));
@@ -227,5 +230,10 @@ void conv_opt(ir_graph *irg)
                changed = 0;
                irg_walk_graph(irg, NULL, conv_opt_walker, NULL);
                local_optimize_graph(irg);
+               invalidate |= changed;
        } while (changed);
+
+       if (invalidate) {
+               set_irg_outs_inconsistent(irg);
+       }
 }