* to their closest copy while introducing phis as necessary.
*
* Algorithm: Mark all blocks in the iterated dominance frontiers of the value
- * and it's copies. Link the copies ordered by dominance to the blocks. The
- * we search for each use all all definitions in the current block, if none is
+ * and it's copies. Link the copies ordered by dominance to the blocks. Then
+ * we search for each use all definitions in the current block, if none is
* found, then we search one in the immediate dominator. If we are in a block
- * of the dominance frontier, create a phi and search do the same search for
- * the phi arguments.
+ * of the dominance frontier, create a phi and do the same search for all
+ * phi arguments.
*
* A copy in this context means, that you want to introduce several new
* abstract values (in Firm: nodes) for which you know, that they
#include "besched_t.h"
#include "beintlive_t.h"
#include "beirg_t.h"
+#include "be_t.h"
#include "debug.h"
#include "error.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
+/**
+ * Checks that low <= what < hi.
+ */
static INLINE int is_inside(unsigned what, unsigned low, unsigned hi)
{
return what - low < hi;
stat_ev_cnt_decl(blocks);
DBG((dbg, LEVEL_3, "Dominance Frontier:"));
stat_ev_tim_push();
- while (!pdeq_empty(env->worklist)) {
+ while (!waitq_empty(env->worklist)) {
int i;
ir_node *block = waitq_get(env->worklist);
ir_node **domfront = be_get_dominance_frontier(env->domfronts, block);
env->min_dom = INT_MAX;
env->max_dom = 0;
- set_using_visited(irg);
+ set_using_irn_visited(irg);
set_using_block_visited(irg);
set_using_irn_link(irg);
del_waitq(env->worklist);
DEL_ARR_F(env->new_phis);
- clear_using_visited(env->irg);
+ clear_using_irn_visited(env->irg);
clear_using_block_visited(env->irg);
clear_using_irn_link(env->irg);
const ir_edge_t *edge, *next;
size_t i;
+ BE_TIMER_PUSH(t_ssa_constr);
+
if(!env->iterated_domfront_calculated) {
mark_iterated_dominance_frontiers(env);
env->iterated_domfront_calculated = 1;
stat_ev_cnt_inc(uses);
}
}
+ BE_TIMER_POP(t_ssa_constr);
+
stat_ev_tim_pop("bessaconstr_fix_time");
stat_ev_cnt_done(uses, "bessaconstr_uses");
}
{
int i, n;
+ BE_TIMER_PUSH(t_ssa_constr);
+
n = ARR_LEN(env->new_phis);
for(i = 0; i < n; ++i) {
ir_node *phi = env->new_phis[i];
be_liveness_introduce(lv, phi);
}
+
+ BE_TIMER_POP(t_ssa_constr);
}
void be_init_ssaconstr(void)