becopyheur4: Clean up co_mst_irn_init().
[libfirm] / ir / opt / opt_confirms.c
index dc67eaf..3049e0e 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -167,12 +153,12 @@ int value_not_zero(const ir_node *n, const ir_node **confirm)
        return (relation != ir_relation_equal) && (relation != ir_relation_unordered);
 
 #undef RET_ON
-}  /* value_not_zero */
+}
 
 /*
  * Check, if the value of a node cannot represent a NULL pointer.
  *
- * - Casts are skipped, Sels are skipped
+ * - Sels are skipped
  * - A SymConst(entity) is NEVER a NULL pointer
  * - Confirms are evaluated
  */
@@ -181,19 +167,17 @@ int value_not_null(const ir_node *n, const ir_node **confirm)
        ir_tarval *tv;
 
        *confirm = NULL;
-       n  = skip_Cast_const(n);
 
        tv = value_of(n);
        if (tarval_is_constant(tv) && ! tarval_is_null(tv))
                return 1;
 
        assert(mode_is_reference(get_irn_mode(n)));
-       /* skip all Sel nodes and Cast's */
+       /* skip all Sel nodes */
        while (is_Sel(n)) {
-               n = skip_Cast(get_Sel_ptr(n));
+               n = get_Sel_ptr(n);
        }
        while (1) {
-               if (is_Cast(n)) { n = get_Cast_op(n); continue; }
                if (is_Proj(n)) { n = get_Proj_pred(n); continue; }
                break;
        }
@@ -209,7 +193,7 @@ int value_not_null(const ir_node *n, const ir_node **confirm)
                return 1;
        } else {
                /* check for more Confirms */
-               for (; is_Confirm(n); n = skip_Cast(get_Confirm_value(n))) {
+               for (; is_Confirm(n); n = get_Confirm_value(n)) {
                        if (get_Confirm_relation(n) == ir_relation_less_greater) {
                                ir_node   *bound = get_Confirm_bound(n);
                                ir_tarval *tv    = value_of(bound);
@@ -222,7 +206,7 @@ int value_not_null(const ir_node *n, const ir_node **confirm)
                }
        }
        return 0;
-}  /* value_not_null */
+}
 
 #ifdef __cplusplus
 extern "C++" {
@@ -337,7 +321,7 @@ ir_value_classify_sign classify_value_sign(ir_node *n)
        default:
                return value_classified_unknown;
        }
-}  /* classify_value_sign */
+}
 
 /**
  * construct an interval from a value
@@ -381,7 +365,7 @@ static interval_t *get_interval_from_tv(interval_t *iv, ir_tarval *tv)
        iv->flags = MIN_INCLUDED | MAX_INCLUDED;
 
        return iv;
-}  /* get_interval_from_tv */
+}
 
 /**
  * construct an interval from a Confirm
@@ -483,7 +467,7 @@ static interval_t *get_interval(interval_t *iv, ir_node *bound, ir_relation rela
        if (iv->min != tarval_bad && iv->max != tarval_bad)
                return iv;
        return NULL;
-}  /* get_interval */
+}
 
 /**
  * Try to evaluate l_iv relation r_iv.
@@ -616,7 +600,7 @@ static ir_tarval *(compare_iv)(const interval_t *l_iv, const interval_t *r_iv, i
                return tarval_bad;
        }
        return tarval_bad;
-}  /* compare_iv */
+}
 
 /**
  * Returns non-zero, if a given relation is transitive.
@@ -624,7 +608,7 @@ static ir_tarval *(compare_iv)(const interval_t *l_iv, const interval_t *r_iv, i
 static int is_transitive(ir_relation relation)
 {
        return (ir_relation_false < relation && relation < ir_relation_less_greater);
-}  /* is_transitive */
+}
 
 /**
  * Return the value of a Cmp if one or both predecessors
@@ -807,7 +791,7 @@ check_null_case:
                DBG_EVAL_CONFIRM(cmp);
 
        return tv;
-}  /* computed_value_Cmp_Confirm */
+}
 
 #ifdef DEBUG_CONFIRM
 /**
@@ -836,7 +820,7 @@ static int iv_snprintf(char *buf, size_t len, const interval_t *iv)
                        return snprintf(buf, len, "%s", smin);
        }
        return snprintf(buf, len, "<UNKNOWN>");
-}  /* iv_snprintf */
+}
 
 /**
  * For debugging. Prints an interval compare.
@@ -853,7 +837,7 @@ static void print_iv_cmp(const interval_t *l_iv, const interval_t *r_iv, ir_rela
        iv_snprintf(sr, sizeof(sr), r_iv);
 
        ir_printf("%s %= %s", sl, relation, sr);
-}  /* print_iv_cmp */
+}
 
 /**
  * For debugging. call *compare_iv() and prints inputs and result.
@@ -873,6 +857,6 @@ static tarval *compare_iv_dbg(const interval_t *l_iv, const interval_t *r_iv, ir
        print_iv_cmp(l_iv, r_iv, relation);
        ir_printf(" = %T\n", tv);
        return tv;
-}  /* compare_iv_dbg */
+}
 
 #endif /* DEBUG_CONFIRM */