X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fopt_confirms.c;h=99c6183020fb1b4b7a21c26cdcfe0ee3cfd3aeeb;hb=8c9921a1fc166552f6e416434fd8394a4fc210a3;hp=664d3048ec4bc262f04698597bebc0c5a24fb89e;hpb=1a3b7d363474ab544c13093a2f0b578718d37c7a;p=libfirm diff --git a/ir/opt/opt_confirms.c b/ir/opt/opt_confirms.c index 664d3048e..99c618302 100644 --- a/ir/opt/opt_confirms.c +++ b/ir/opt/opt_confirms.c @@ -21,7 +21,6 @@ * @file * @brief Optimizations regarding Confirm nodes. * @author Michael Beck - * @version $Id$ */ #include "config.h" @@ -67,25 +66,25 @@ static tarval *compare_iv_dbg(const interval_t *l_iv, const interval_t *r_iv, ir #define DBG_OUT_TR(l_relation, l_bound, r_relation, r_bound, relation, v) \ ir_printf("In %e:\na %= %n && b %= %n ==> a %= b == %s\n", \ get_irg_entity(current_ir_graph), \ - l_relation, l_bound, r_relation, r_bound, relation, v); + l_relation, l_bound, r_relation, r_bound, relation, v) /* right side */ #define DBG_OUT_R(r_relation, r_bound, left, relation, right, v) \ ir_printf("In %e:\na %= %n ==> %n %= %n == %s\n", \ get_irg_entity(current_ir_graph), \ - r_relation, r_bound, left, relation, right, v); + r_relation, r_bound, left, relation, right, v) /* left side */ #define DBG_OUT_L(l_relation, l_bound, left, relation, right, v) \ ir_printf("In %e:\na %= %n ==> %n %= %n == %s\n", \ get_irg_entity(current_ir_graph), \ - l_relation, l_bound, left, relation, right, v); + l_relation, l_bound, left, relation, right, v) #else -#define DBG_OUT_TR(l_relation, l_bound, r_relation, r_bound, relation, v) -#define DBG_OUT_R(r_relation, r_bound, left, relation, right, v) -#define DBG_OUT_L(l_relation, l_bound, left, relation, right, v) +#define DBG_OUT_TR(l_relation, l_bound, r_relation, r_bound, relation, v) (void)0 +#define DBG_OUT_R(r_relation, r_bound, left, relation, right, v) (void)0 +#define DBG_OUT_L(l_relation, l_bound, left, relation, right, v) (void)0 #endif /* DEBUG_CONFIRM */ @@ -97,7 +96,7 @@ static tarval *compare_iv_dbg(const interval_t *l_iv, const interval_t *r_iv, ir */ FIRM_API int value_not_zero(const ir_node *n, ir_node_cnst_ptr *confirm) { -#define RET_ON(x) if (x) { *confirm = n; return 1; }; break +#define RET_ON(x) if (x) { *confirm = n; return 1; } break ir_tarval *tv; ir_mode *mode = get_irn_mode(n); @@ -168,9 +167,7 @@ FIRM_API int value_not_zero(const ir_node *n, ir_node_cnst_ptr *confirm) /* * Check, if the value of a node cannot represent a NULL pointer. * - * - Casts are skipped - * - If sel_based_null_check_elim is enabled, all - * Sel nodes can be skipped. + * - Casts are skipped, Sels are skipped * - A SymConst(entity) is NEVER a NULL pointer * - Confirms are evaluated */ @@ -186,11 +183,9 @@ FIRM_API int value_not_null(const ir_node *n, ir_node_cnst_ptr *confirm) return 1; assert(mode_is_reference(get_irn_mode(n))); - if (get_opt_sel_based_null_check_elim()) { - /* skip all Sel nodes and Cast's */ - while (is_Sel(n)) { - n = skip_Cast(get_Sel_ptr(n)); - } + /* skip all Sel nodes and Cast's */ + while (is_Sel(n)) { + n = skip_Cast(get_Sel_ptr(n)); } while (1) { if (is_Cast(n)) { n = get_Cast_op(n); continue; } @@ -198,7 +193,7 @@ FIRM_API int value_not_null(const ir_node *n, ir_node_cnst_ptr *confirm) break; } - if (is_Global(n)) { + if (is_SymConst_addr_ent(n)) { /* global references are never NULL */ return 1; } else if (n == get_irg_frame(get_irn_irg(n))) { @@ -641,7 +636,6 @@ FIRM_API ir_tarval *computed_value_Cmp_Confirm(const ir_node *cmp, ir_node *left ir_relation l_relation, res_relation, neg_relation; interval_t l_iv, r_iv; ir_tarval *tv; - ir_mode *mode; if (is_Confirm(right)) { /* we want the Confirm on the left side */ @@ -722,7 +716,6 @@ FIRM_API ir_tarval *computed_value_Cmp_Confirm(const ir_node *cmp, ir_node *left * We know that a CMP b and check for a ~CMP b */ else { - mode = get_irn_mode(left); neg_relation = get_negated_relation(relation); if ((r_relation == neg_relation) || (r_relation == (neg_relation & ~ir_relation_equal))) { @@ -767,7 +760,6 @@ FIRM_API ir_tarval *computed_value_Cmp_Confirm(const ir_node *cmp, ir_node *left * We know that a CMP b and check for a ~CMP b */ else { - mode = get_irn_mode(left); neg_relation = get_negated_relation(relation); if ((l_relation == neg_relation) || (l_relation == (neg_relation & ~ir_relation_equal))) {