aboutsummaryrefslogtreecommitdiffstats
path: root/cse.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-07 14:08:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:35 -0700
commit2d8d9bda591831a9d0acc478f7d3b8fa35032b6e (patch)
tree3d14bcc9b65c1f94ad0036d45668ba9f89801862 /cse.c
parent572561dcb58a252164d9c4fc5a849baf34106284 (diff)
downloadsparse-2d8d9bda591831a9d0acc478f7d3b8fa35032b6e.tar.gz
sparse-2d8d9bda591831a9d0acc478f7d3b8fa35032b6e.tar.xz
sparse-2d8d9bda591831a9d0acc478f7d3b8fa35032b6e.zip
Make OP_PHISOURCE track the OP_PHI instructions that it defines.
This allows us to always see which pseudos are nonlocally affected by the phi source. We can only do this after the instruction flow is fixed, together with the OP_DEATHNOTE phase.
Diffstat (limited to 'cse.c')
-rw-r--r--cse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cse.c b/cse.c
index 47cd78f..6835aac 100644
--- a/cse.c
+++ b/cse.c
@@ -20,8 +20,6 @@
#define INSN_HASH_SIZE 65536
static struct instruction_list *insn_hash_table[INSN_HASH_SIZE];
-#define hashval(x) ((unsigned long)(x))
-
int repeat_phase, merge_phi_sources;
static int phi_compare(pseudo_t phi1, pseudo_t phi2)
@@ -96,7 +94,7 @@ static void clean_up_one_instruction(struct basic_block *bb, struct instruction
}
case OP_PHISOURCE:
- hash += hashval(insn->src1);
+ hash += hashval(insn->phi_src);
hash += hashval(insn->bb);
break;
@@ -209,7 +207,7 @@ static int insn_compare(const void *_i1, const void *_i2)
return phi_list_compare(i1->phi_list, i2->phi_list);
case OP_PHISOURCE:
- if (i1->src1 != i2->src1)
+ if (i1->phi_src != i2->phi_src)
return i1->src1 < i2->src1 ? -1 : 1;
if (i1->bb != i2->bb)
return i1->bb < i2->bb ? -1 : 1;