aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/flow.c
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-16 16:59:58 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:04:34 -0700
commit0de2ae2ec4814dbc19535728215e0a82a86bd136 (patch)
tree6548a4eea76bb5460930768f272361e83091d5ef /flow.c
parenta25eb46654bcc274b81af4f6aee2ea640c067e8a (diff)
downloadsparse-dev-0de2ae2ec4814dbc19535728215e0a82a86bd136.tar.gz
Revert the last load dominator change.
I realized that the case where I really wanted to do this optimization is actually the case where this case can never trigger: when there is only one assignment to a symbol, we've gone the easy way and replaced all the loads without actually doing any dominator work at all. That implies that if we want to find dominating tests, we'd better do so separately rather than during the load dominance phase. Cset exclude: torvalds@ppc970.osdl.org|ChangeSet|20041116234705|05860
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/flow.c b/flow.c
index 3cb34925..bc0f0d61 100644
--- a/flow.c
+++ b/flow.c
@@ -206,15 +206,6 @@ static int dominates(pseudo_t pseudo, struct instruction *insn,
return 1;
}
-static pseudo_t load_dominator(struct instruction *insn, struct instruction *dom)
-{
- /*
- * We should eventually see if we can determine a more precise
- * value by seeing if the load value gets tested..
- */
- return dom->target;
-}
-
static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn,
struct basic_block *bb, unsigned long generation, struct phi_list **dominators,
int local, int loads)
@@ -225,7 +216,6 @@ static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn,
loads = 0;
FOR_EACH_PTR(bb->parents, parent) {
struct instruction *one;
- pseudo_t target;
struct phi *phi;
FOR_EACH_PTR_REVERSE(parent->insns, one) {
@@ -240,12 +230,8 @@ static int find_dominating_parents(pseudo_t pseudo, struct instruction *insn,
}
if (!dominance)
continue;
- target = one->target;
- if (one->opcode == OP_LOAD) {
- if (!loads)
- continue;
- target = load_dominator(insn, one);
- }
+ if (one->opcode == OP_LOAD && !loads)
+ continue;
goto found_dominator;
} END_FOR_EACH_PTR_REVERSE(one);
no_dominance:
@@ -258,7 +244,7 @@ no_dominance:
continue;
found_dominator:
- phi = alloc_phi(parent, target);
+ phi = alloc_phi(parent, one->target);
add_phi(dominators, phi);
} END_FOR_EACH_PTR(parent);
return 1;
@@ -352,10 +338,7 @@ found:
return 0;
if (dom) {
- pseudo_t target = dom->target;
- if (dom->opcode == OP_LOAD)
- target = load_dominator(insn, dom);
- convert_load_insn(insn, target);
+ convert_load_insn(insn, dom->target);
return 1;
}