X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fexecution_frequency.c;h=76842770a2a5081cafa9758214885318d3533db4;hb=0f234e2d94155d13c0e4727871125beda0eaa66d;hp=907f9f38473bf9f26a51b909305e8114efc48733;hpb=3571b99127e71fef4e0e017b2b60ea5be6210468;p=libfirm diff --git a/ir/ana/execution_frequency.c b/ir/ana/execution_frequency.c index 907f9f384..76842770a 100644 --- a/ir/ana/execution_frequency.c +++ b/ir/ana/execution_frequency.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -24,13 +24,10 @@ * @date 5.11.2004 * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "execution_frequency.h" -#include "firm_common_t.h" #include "set.h" #include "pdeq.h" #include "hashptr.h" @@ -67,11 +64,11 @@ static int exec_freq_cmp(const void *e1, const void *e2, size_t size) { return (ef1->reg != ef2->reg); } -static INLINE unsigned int exec_freq_hash(reg_exec_freq *e) { +static inline unsigned int exec_freq_hash(reg_exec_freq *e) { return HASH_PTR(e->reg); } -static INLINE void set_region_exec_freq(void *reg, double freq) { +static inline void set_region_exec_freq(void *reg, double freq) { reg_exec_freq ef; ef.reg = reg; ef.freq = freq; @@ -192,12 +189,12 @@ static void my_irg_walk_current_graph(irg_walk_func *pre, irg_walk_func *post, v static void walk_pre(ir_node *n, void *env) { (void) env; - if (get_irn_op(n) == op_Raise) + if (is_Raise(n)) just_passed_a_Raise = 1; - if ( (get_irn_op(n) == op_Proj) - && (get_irn_op(get_Proj_pred(n)) == op_Cond) - && (just_passed_a_Raise)) { + if (get_irn_op(n) == op_Proj && + is_Cond(get_Proj_pred(n)) && + just_passed_a_Raise) { ir_node *other_proj; ir_node *c = get_Proj_pred(n); @@ -215,7 +212,7 @@ static void walk_pre(ir_node *n, void *env) } } - if (get_irn_op(n) == op_Cond) { + if (is_Cond(n)) { set_irn_link(n, Cond_list); Cond_list = n; } @@ -224,13 +221,14 @@ static void walk_pre(ir_node *n, void *env) static void walk_post(ir_node *n, void *env) { (void) env; - if (get_irn_op(n) == op_Raise) + if (is_Raise(n)) just_passed_a_Raise = 0; - if ( (get_irn_op(n) == op_Proj) - && (get_irn_op(get_Proj_pred(n)) == op_Cond) - && ((get_ProjX_probability(n) == Cond_prob_exception_taken) || - (get_ProjX_probability(n) == Cond_prob_was_exception_taken) )) { + if (get_irn_op(n) == op_Proj && + is_Cond(get_Proj_pred(n)) && ( + get_ProjX_probability(n) == Cond_prob_exception_taken || + get_ProjX_probability(n) == Cond_prob_was_exception_taken + )) { just_passed_a_Raise = 1; } } @@ -296,7 +294,7 @@ int is_fragile_Proj(ir_node *n) { static double exception_prob = 0.001; -static INLINE int is_loop_head(ir_node *cond) +static inline int is_loop_head(ir_node *cond) { (void) cond; return 0; @@ -306,7 +304,7 @@ static INLINE int is_loop_head(ir_node *cond) * * Given all outs of the predecessor region, we can compute the weight of * this single edge. */ -static INLINE double get_weighted_region_exec_freq(void *reg, int pos) { +static inline double get_weighted_region_exec_freq(void *reg, int pos) { void *pred_reg = get_region_in(reg, pos); double res, full_freq = get_region_exec_freq (pred_reg); int n_outs = get_region_n_outs (pred_reg); @@ -315,7 +313,7 @@ static INLINE double get_weighted_region_exec_freq(void *reg, int pos) { ir_node *cfop; if (is_ir_node(reg)) { cfop = get_Block_cfgpred((ir_node *)reg, pos); - if (is_Proj(cfop) && (get_irn_op(get_Proj_pred(cfop)) != op_Cond)) + if (is_Proj(cfop) && !is_Cond(get_Proj_pred(cfop))) cfop = skip_Proj(cfop); } else { assert(is_ir_loop(reg)); @@ -333,7 +331,7 @@ static INLINE double get_weighted_region_exec_freq(void *reg, int pos) { return res; } -static INLINE void compute_region_freqency(void *reg, double head_weight) { +static inline void compute_region_freqency(void *reg, double head_weight) { int i, n_ins = get_region_n_ins(reg); double my_freq = 0;