aboutsummaryrefslogtreecommitdiffstats
path: root/cse.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-24 16:27:30 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:04:44 -0700
commitc484f3f7f5c683282990b87f71be4d8cf698b73b (patch)
tree35c826e6e27d3ebea7eb6758dd15e00f5a1408e9 /cse.c
parent6e4960a358f3ed57b59de824077ca98ee6b412e5 (diff)
downloadsparse-c484f3f7f5c683282990b87f71be4d8cf698b73b.tar.gz
sparse-c484f3f7f5c683282990b87f71be4d8cf698b73b.tar.xz
sparse-c484f3f7f5c683282990b87f71be4d8cf698b73b.zip
Oops. Clean up some left-overs from phi removal.
The "half-way" point was making the phi be an instruction, and some of that half-way stuff remained.
Diffstat (limited to 'cse.c')
-rw-r--r--cse.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/cse.c b/cse.c
index 2bbc1e5..f01f643 100644
--- a/cse.c
+++ b/cse.c
@@ -144,7 +144,8 @@ static void if_convert_phi(struct instruction *insn)
static unsigned long clean_up_phi(struct instruction *insn)
{
- struct instruction *phi, *last;
+ pseudo_t phi;
+ struct instruction *last;
unsigned long hash = 0;
int same;
@@ -153,21 +154,22 @@ static unsigned long clean_up_phi(struct instruction *insn)
last = NULL;
same = 1;
FOR_EACH_PTR(insn->phi_list, phi) {
- if (phi->src1 == VOID) {
+ struct instruction *def = phi->def;
+ if (def->src1 == VOID) {
DELETE_CURRENT_PTR(phi);
continue;
}
if (last) {
- if (last->src1 != phi->src1) {
+ if (last->src1 != def->src1) {
same = 0;
- } else if (last->bb == phi->bb) {
+ } else if (last->bb == def->bb) {
DELETE_CURRENT_PTR(phi);
continue;
}
}
- last = phi;
- hash += hashval(phi->src1);
- hash += hashval(phi->bb);
+ last = def;
+ hash += hashval(def->src1);
+ hash += hashval(def->bb);
} END_FOR_EACH_PTR(phi);
/* Whenever we delete pointers, we may have to pack the end result */
@@ -316,7 +318,7 @@ extern void show_instruction(struct instruction *);
/* Compare two (sorted) phi-lists */
static int phi_list_compare(struct pseudo_list *l1, struct pseudo_list *l2)
{
- struct instruction *phi1, *phi2;
+ pseudo_t phi1, phi2;
PREPARE_PTR_LIST(l1, phi1);
PREPARE_PTR_LIST(l2, phi2);