mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[qfcc] Shuffle some code around to be clearer
Doing the same thing at the end of two branches of an if/else seems off. And doing an associative(?) set operation every time through a loop is wasteful.
This commit is contained in:
parent
7338689146
commit
809c103fd1
1 changed files with 3 additions and 4 deletions
|
@ -458,12 +458,11 @@ flow_kill_aliases (set_t *kill, flowvar_t *var, const set_t *uninit)
|
||||||
if (op->op_type == op_temp) {
|
if (op->op_type == op_temp) {
|
||||||
tempop_visit_all (&op->o.tempop, 1, flow_tempop_kill_aliases_visit,
|
tempop_visit_all (&op->o.tempop, 1, flow_tempop_kill_aliases_visit,
|
||||||
tmp);
|
tmp);
|
||||||
set_difference (tmp, uninit);
|
|
||||||
} else if (op->op_type == op_def) {
|
} else if (op->op_type == op_def) {
|
||||||
def_visit_all (op->o.def, 1, flow_def_kill_aliases_visit, tmp);
|
def_visit_all (op->o.def, 1, flow_def_kill_aliases_visit, tmp);
|
||||||
// don't allow aliases to kill definitions in the entry dummy block
|
|
||||||
set_difference (tmp, uninit);
|
|
||||||
}
|
}
|
||||||
|
// don't allow aliases to kill definitions in the entry dummy block
|
||||||
|
set_difference (tmp, uninit);
|
||||||
// merge the alias kills with the current def's kills
|
// merge the alias kills with the current def's kills
|
||||||
set_union (kill, tmp);
|
set_union (kill, tmp);
|
||||||
}
|
}
|
||||||
|
@ -492,8 +491,8 @@ flow_reaching_defs (flowgraph_t *graph)
|
||||||
for (i = 0; i < graph->func->num_vars; i++) {
|
for (i = 0; i < graph->func->num_vars; i++) {
|
||||||
var = graph->func->vars[i];
|
var = graph->func->vars[i];
|
||||||
set_union (uninit, var->define);// do not want alias handling here
|
set_union (uninit, var->define);// do not want alias handling here
|
||||||
set_difference (uninit, kill); // remove any gens from the function
|
|
||||||
}
|
}
|
||||||
|
set_difference (uninit, kill); // remove any gens from the function
|
||||||
graph->nodes[graph->num_nodes]->reaching_defs.out = uninit;
|
graph->nodes[graph->num_nodes]->reaching_defs.out = uninit;
|
||||||
graph->nodes[graph->num_nodes]->reaching_defs.in = set_new ();
|
graph->nodes[graph->num_nodes]->reaching_defs.in = set_new ();
|
||||||
graph->nodes[graph->num_nodes]->reaching_defs.gen = set_new ();
|
graph->nodes[graph->num_nodes]->reaching_defs.gen = set_new ();
|
||||||
|
|
Loading…
Reference in a new issue