diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-28 20:38:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:05:14 -0700 |
commit | 89e78a3b4700b9c1cc204266772d4fe0647b1656 (patch) | |
tree | 7a5ad5083ae2a836566550d465462fe8946c0b8f /cse.c | |
parent | Oops. Don't try to CSE OP_SEL, at least not until we learn to (diff) | |
download | sparse-89e78a3b4700b9c1cc204266772d4fe0647b1656.tar.gz sparse-89e78a3b4700b9c1cc204266772d4fe0647b1656.tar.bz2 sparse-89e78a3b4700b9c1cc204266772d4fe0647b1656.zip |
Start using instruction sizes properly.
We should drop symbol types by now, and base things on just raw
sizes. Anything else just doesn't work from a CSE standpoint.
Some things may care about actual types later, notably the type-
based alias analysis. Those types still exist in the cast nodes.
Also, make the printout be more readable.
Diffstat (limited to 'cse.c')
-rw-r--r-- | cse.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -45,7 +45,7 @@ static void clean_up_one_instruction(struct basic_block *bb, struct instruction return; assert(insn->bb == bb); repeat_phase |= simplify_instruction(insn); - hash = insn->opcode; + hash = (insn->opcode << 3) + (insn->size >> 3); switch (insn->opcode) { /* Binary arithmetic */ @@ -218,6 +218,8 @@ static int insn_compare(const void *_i1, const void *_i2) default: warning(i1->bb->pos, "bad instruction on hash chain"); } + if (i1->size != i2->size) + return i1->size < i2->size ? -1 : 1; return 0; } |