Use is_Const_null() instead of tarval_is_null(get_Const_tarval()).
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 17 Sep 2007 16:26:46 +0000 (16:26 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Mon, 17 Sep 2007 16:26:46 +0000 (16:26 +0000)
[r15843]

ir/ir/iropt.c
ir/opt/opt_confirms.c

index 3420e34..5c802b6 100644 (file)
@@ -925,7 +925,7 @@ static ir_node *equivalent_node_left_zero(ir_node *n) {
        ir_node *a = get_binop_left(n);
        ir_node *b = get_binop_right(n);
 
        ir_node *a = get_binop_left(n);
        ir_node *b = get_binop_right(n);
 
-       if (tarval_is_null(value_of(b))) {
+       if (is_Const(b) && is_Const_null(b)) {
                n = a;
 
                DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_0);
                n = a;
 
                DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_0);
@@ -959,7 +959,7 @@ static ir_node *equivalent_node_Sub(ir_node *n) {
        b = get_Sub_right(n);
 
        /* Beware: modes might be different */
        b = get_Sub_right(n);
 
        /* Beware: modes might be different */
-       if (tarval_is_null(value_of(b))) {
+       if (is_Const(b) && is_Const_null(b)) {
                ir_node *a = get_Sub_left(n);
                if (mode == get_irn_mode(a)) {
                        n = a;
                ir_node *a = get_Sub_left(n);
                if (mode == get_irn_mode(a)) {
                        n = a;
@@ -1099,10 +1099,10 @@ static ir_node *equivalent_node_Or(ir_node *n) {
        if (a == b) {
                n = a;    /* Or has it's own neutral element */
                DBG_OPT_ALGSIM0(oldn, n, FS_OPT_OR);
        if (a == b) {
                n = a;    /* Or has it's own neutral element */
                DBG_OPT_ALGSIM0(oldn, n, FS_OPT_OR);
-       } else if (tarval_is_null(value_of(a))) {
+       } else if (is_Const(a) && is_Const_null(a)) {
                n = b;
                DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_OR);
                n = b;
                DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_OR);
-       } else if (tarval_is_null(value_of(b))) {
+       } else if (is_Const(b) && is_Const_null(b)) {
                n = a;
                DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_OR);
        }
                n = a;
                DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_OR);
        }
@@ -3426,9 +3426,7 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
        }
 
        /* TODO extend to arbitrary constants */
        }
 
        /* TODO extend to arbitrary constants */
-       if (is_Conv(left) &&
-                       is_Const(right) &&
-                       tarval_is_null(get_Const_tarval(right))) {
+       if (is_Conv(left) && is_Const(right) && is_Const_null(right)) {
                ir_mode* mode    = get_irn_mode(left);
                ir_node* op      = get_Conv_op(left);
                ir_mode* op_mode = get_irn_mode(op);
                ir_mode* mode    = get_irn_mode(left);
                ir_node* op      = get_Conv_op(left);
                ir_mode* op_mode = get_irn_mode(op);
index a0f7ceb..861051e 100644 (file)
@@ -184,9 +184,7 @@ int value_not_null(ir_node *n, ir_node **confirm) {
        if (op == op_SymConst && get_SymConst_kind(n) == symconst_addr_ent)
                return 1;
        if (op == op_Const) {
        if (op == op_SymConst && get_SymConst_kind(n) == symconst_addr_ent)
                return 1;
        if (op == op_Const) {
-               tarval *tv = get_Const_tarval(n);
-
-               if (tv != tarval_bad && !tarval_is_null(tv))
+               if (!is_Const_null(n))
                        return 1;
        } else {
                for (; is_Confirm(n); n = skip_Cast(get_Confirm_value(n))) {
                        return 1;
        } else {
                for (; is_Confirm(n); n = skip_Cast(get_Confirm_value(n))) {