From f83f5665ba95a8b7578f85b3ee6718e5a990f20f Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 17 Sep 2007 16:26:46 +0000 Subject: [PATCH] Use is_Const_null() instead of tarval_is_null(get_Const_tarval()). [r15843] --- ir/ir/iropt.c | 12 +++++------- ir/opt/opt_confirms.c | 4 +--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 3420e3415..5c802b68e 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -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); - 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); @@ -959,7 +959,7 @@ static ir_node *equivalent_node_Sub(ir_node *n) { 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; @@ -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); - } 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); - } 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); } @@ -3426,9 +3426,7 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) { } /* 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); diff --git a/ir/opt/opt_confirms.c b/ir/opt/opt_confirms.c index a0f7ceb53..861051edd 100644 --- a/ir/opt/opt_confirms.c +++ b/ir/opt/opt_confirms.c @@ -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) { - 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))) { -- 2.20.1