Teach new_tarval_from_str_int() to parse binary numbers: 0[bB][01]+.
[libfirm] / ir / be / betranshlp.c
index 660ec7a..5158d4d 100644 (file)
@@ -22,7 +22,6 @@
  * @brief       be transform helper extracted from the ia32 backend.
  * @author      Matthias Braun, Michael Beck
  * @date        14.06.2007
- * @version     $Id$
  */
 #include "config.h"
 
@@ -150,7 +149,7 @@ static ir_node *transform_end(ir_node *node)
 
 void be_start_transform_setup(void)
 {
-       clear_irp_opcodes_generic_func();
+       ir_clear_opcodes_generic_func();
 
        be_set_transform_function(op_Bad,         be_duplicate_node);
        be_set_transform_function(op_be_Copy,     be_duplicate_node);
@@ -211,7 +210,7 @@ ir_node *be_transform_node(ir_node *node)
        if (new_node != NULL)
                return new_node;
 
-       DEBUG_ONLY(be_set_transformed_node(node, NULL));
+       DEBUG_ONLY(be_set_transformed_node(node, NULL);)
 
        op = get_irn_op(node);
        if (op->ops.generic == NULL) {
@@ -350,7 +349,6 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
 
        /* pre transform some anchors (so they are available in the other transform
         * functions) */
-       pre_transform_anchor(irg, anchor_bad);
        pre_transform_anchor(irg, anchor_no_mem);
        pre_transform_anchor(irg, anchor_end_block);
        pre_transform_anchor(irg, anchor_end);
@@ -400,10 +398,7 @@ void be_transform_graph(ir_graph *irg, arch_pretrans_nodes *func)
        irg->obst = new_obst;
        irg->last_node_idx = 0;
 
-       /* invalidate phase info as (at least vrp info) is used inside the
-        * equivalent/compute_value functions and might replace our newly
-        * created nodes with middleend nodes */
-       irg_invalidate_phases(irg);
+       free_vrp_data(irg);
 
        /* create new value table for CSE */
        new_identities(irg);
@@ -423,73 +418,12 @@ void be_transform_graph(ir_graph *irg, arch_pretrans_nodes *func)
        free_irg_outs(irg);
        free_trouts();
        free_loop_information(irg);
-       set_irg_doms_inconsistent(irg);
+       clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
 
-       be_liveness_invalidate(be_get_irg_liveness(irg));
-       /* Hack for now, something is buggy with invalidate liveness... */
-       be_birg_from_irg(irg)->lv = NULL;
+       be_invalidate_live_chk(irg);
        be_invalidate_dom_front(irg);
 
        /* recalculate edges */
        edges_deactivate(irg);
        edges_activate(irg);
 }
-
-int be_mux_is_abs(ir_node *sel, ir_node *mux_true, ir_node *mux_false)
-{
-       ir_node    *cmp_left;
-       ir_node    *cmp_right;
-       ir_mode    *mode;
-       ir_relation relation;
-
-       if (!is_Cmp(sel))
-               return 0;
-
-       /**
-        * Note further that these optimization work even for floating point
-        * with NaN's because -NaN == NaN.
-        * However, if +0 and -0 is handled differently, we cannot use the Abs/-Abs
-        * transformations.
-        */
-       mode = get_irn_mode(mux_true);
-       if (mode_honor_signed_zeros(mode))
-               return 0;
-
-       /* must be <, <=, >=, > */
-       relation = get_Cmp_relation(sel);
-       if ((relation & ir_relation_less_greater) == 0)
-               return 0;
-
-       if (!ir_is_negated_value(mux_true, mux_false))
-               return 0;
-
-       /* must be x cmp 0 */
-       cmp_right = get_Cmp_right(sel);
-       if (!is_Const(cmp_right) || !is_Const_null(cmp_right))
-               return 0;
-
-       cmp_left = get_Cmp_left(sel);
-       if (cmp_left == mux_false) {
-               if (relation & ir_relation_less) {
-                       return 1;
-               } else {
-                       assert(relation & ir_relation_greater);
-                       return -1;
-               }
-       } else if (cmp_left == mux_true) {
-               if (relation & ir_relation_less) {
-                       return -1;
-               } else {
-                       assert(relation & ir_relation_greater);
-                       return 1;
-               }
-       }
-
-       return 0;
-}
-
-ir_node *be_get_abs_op(ir_node *sel)
-{
-       ir_node *cmp_left = get_Cmp_left(sel);
-       return cmp_left;
-}