aboutsummaryrefslogtreecommitdiff
path: root/cse.c
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2007-07-29 22:32:22 -0700
committerJosh Triplett <josh@freedesktop.org>2007-07-29 22:50:42 -0700
commitb5a8032aaeaf2121a642ead32653d4288fa2983d (patch)
tree2c12e04b893a5cfc4f24971ed5ddaa6b067ecdf9 /cse.c
parentMakefile: Use -O2 -finline-functions, not just -O (diff)
downloadsparse-b5a8032aaeaf2121a642ead32653d4288fa2983d.tar.gz
sparse-b5a8032aaeaf2121a642ead32653d4288fa2983d.tar.bz2
sparse-b5a8032aaeaf2121a642ead32653d4288fa2983d.zip
cse: Size insn_hash_table more realistically, speeding up CSE significantly
Profiling showed that Sparse spent much of its time doing CSE, which involved traversing every bucket of insn_hash_table repeatedly. insn_hash_table had 64K buckets, but never more than a few dozen entries. Shrink insn_hash_table to 256 entries. This makes Sparse 2-4 times faster for me. Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'cse.c')
-rw-r--r--cse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cse.c b/cse.c
index 9370a6c..2a15745 100644
--- a/cse.c
+++ b/cse.c
@@ -17,7 +17,7 @@
#include "linearize.h"
#include "flow.h"
-#define INSN_HASH_SIZE 65536
+#define INSN_HASH_SIZE 256
static struct instruction_list *insn_hash_table[INSN_HASH_SIZE];
int repeat_phase;