avoid verifier warnings in sparc by explicitely modeling RestoreZero using the frame...
[libfirm] / ir / ir / iropt.c
index f613df6..7a7d41e 100644 (file)
@@ -447,8 +447,8 @@ static ir_tarval *computed_value_Confirm(const ir_node *n)
  * gives a (conservative) estimation of possible relation when comparing
  * left+right
  */
-static ir_relation determine_possible_cmp_relations(const ir_node *left,
-                                                    const ir_node *right)
+ir_relation ir_get_possible_cmp_relations(const ir_node *left,
+                                          const ir_node *right)
 {
        ir_relation possible = ir_relation_true;
        ir_tarval  *tv_l     = value_of(left);
@@ -498,7 +498,7 @@ static ir_tarval *computed_value_Cmp(const ir_node *cmp)
 {
        ir_node    *left     = get_Cmp_left(cmp);
        ir_node    *right    = get_Cmp_right(cmp);
-       ir_relation possible = determine_possible_cmp_relations(left, right);
+       ir_relation possible = ir_get_possible_cmp_relations(left, right);
        ir_relation relation = get_Cmp_relation(cmp);
 
        /* if none of the requested relations is possible, return false */
@@ -1075,11 +1075,11 @@ static ir_node *equivalent_node_Or(ir_node *n)
        ir_tarval *tv;
 
        if (a == b) {
-               n = a;    /* Or has it's own neutral element */
+               n = a;    /* idempotence */
                DBG_OPT_ALGSIM0(oldn, n, FS_OPT_OR);
                return n;
        }
-       /* constants are cormalized to right, check this site first */
+       /* constants are normalized to right, check this side first */
        tv = value_of(b);
        if (tarval_is_null(tv)) {
                n = a;
@@ -1108,11 +1108,11 @@ static ir_node *equivalent_node_And(ir_node *n)
        ir_tarval *tv;
 
        if (a == b) {
-               n = a;    /* And has it's own neutral element */
+               n = a;    /* idempotence */
                DBG_OPT_ALGSIM0(oldn, n, FS_OPT_AND);
                return n;
        }
-       /* constants are normalized to right, check this site first */
+       /* constants are normalized to right, check this side first */
        tv = value_of(b);
        if (tarval_is_all_one(tv)) {
                n = a;
@@ -1322,11 +1322,11 @@ static ir_node *equivalent_node_Phi(ir_node *n)
                first_val = get_Phi_pred(n, i);
                if (   (first_val != n)                            /* not self pointer */
 #if 0
-                   /* BEWARE: when the if is changed to 1, Phi's will ignore it's Bad
-                    * predecessors. Then, Phi nodes in dead code might be removed, causing
-                    * nodes pointing to themself (Add's for instance).
-                    * This is really bad and causes endless recursions in several
-                    * code pathes, so we do NOT optimize such code.
+                   /* BEWARE: when the if is changed to 1, Phis will ignore their Bad
+                    * predecessors. Then, Phi nodes in unreachable code might be removed,
+                    * causing nodes pointing to themselev (Adds for instance).
+                    * This is really bad and causes endless recursion on several
+                    * code pathes, so we do NOT optimize such code.
                     * This is not that bad as it sounds, optimize_cf() removes bad control flow
                     * (and bad Phi predecessors), so live code is optimized later.
                     */
@@ -1592,7 +1592,7 @@ static ir_node *equivalent_node_Proj_Store(ir_node *proj)
 }  /* equivalent_node_Proj_Store */
 
 /**
- * Does all optimizations on nodes that must be done on it's Proj's
+ * Does all optimizations on nodes that must be done on its Projs
  * because of creating new nodes.
  */
 static ir_node *equivalent_node_Proj(ir_node *proj)
@@ -3800,7 +3800,7 @@ static ir_node *transform_node_Cmp(ir_node *n)
        bool        changed  = false;
        bool        changedc = false;
        ir_relation relation = get_Cmp_relation(n);
-       ir_relation possible = determine_possible_cmp_relations(left, right);
+       ir_relation possible = ir_get_possible_cmp_relations(left, right);
 
        /* mask out impossible relations */
        ir_relation new_relation = relation & possible;
@@ -4537,7 +4537,7 @@ static ir_node *transform_node_Proj_Bound(ir_node *proj)
 }  /* transform_node_Proj_Bound */
 
 /**
- * Does all optimizations on nodes that must be done on it's Proj's
+ * Does all optimizations on nodes that must be done on its Projs
  * because of creating new nodes.
  */
 static ir_node *transform_node_Proj(ir_node *proj)
@@ -4774,7 +4774,7 @@ static ir_node *transform_node_Or_Rotl(ir_node *irn_or)
 
        /* Note: the obvious rot formulation (a << x) | (a >> (32-x)) gets
         * transformed to (a << x) | (a >> -x) by transform_node_shift_modulo() */
-       if (!is_negated_value(c1, c2)) {
+       if (!ir_is_negated_value(c1, c2)) {
                return irn_or;
        }
 
@@ -5356,7 +5356,7 @@ static ir_node *transform_node_End(ir_node *n)
        return n;
 }  /* transform_node_End */
 
-bool is_negated_value(ir_node *a, ir_node *b)
+int ir_is_negated_value(const ir_node *a, const ir_node *b)
 {
        if (is_Minus(a) && get_Minus_op(a) == b)
                return true;
@@ -5650,7 +5650,7 @@ static ir_node *transform_node_Call(ir_node *call)
        ir_graph *irg;
        type_dbg_info *tdb;
        dbg_info *db;
-       int      i, n_res, n_param;
+       size_t   i, n_res, n_param;
        ir_variadicity var;
 
        if (! is_Proj(callee))
@@ -6308,7 +6308,7 @@ static ir_node *gigo(ir_node *node)
 #if 0
                        /* Propagating Unknowns here seems to be a bad idea, because
                           sometimes we need a node as a input and did not want that
-                          it kills it's user.
+                          it kills its user.
                           However, it might be useful to move this into a later phase
                           (if you think that optimizing such code is useful). */
                        if (is_Unknown(pred) && mode_is_data(get_irn_mode(node)))
@@ -6371,7 +6371,7 @@ ir_node *optimize_node(ir_node *n)
                                size_t node_size;
 
                                /*
-                                * we MUST copy the node here temporary, because it's still
+                                * we MUST copy the node here temporarily, because it's still
                                 * needed for DBG_OPT_CSTEVAL
                                 */
                                node_size = offsetof(ir_node, attr) +  n->op->attr_size;