[dev.ssa] cmd/compile: make cse faster

It is one of the slowest compiler phases right now, and we
run two of them.

Instead of using a map to make the initial partition, use a sort.
It is much less memory intensive.

Do a few optimizations to avoid work for size-1 equivalence classes.

Implement -N.

Change-Id: I1d2d85d3771abc918db4dd7cc30b0b2d854b15e1
Reviewed-on: https://go-review.googlesource.com/19024
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Keith Randall 2016-01-27 16:47:23 -08:00
parent 7b773946c0
commit 6a96a2fe5a
10 changed files with 206 additions and 276 deletions

View file

@ -16,7 +16,7 @@ var Deadcode = deadcode
func testConfig(t *testing.T) *Config {
testCtxt := &obj.Link{}
return NewConfig("amd64", DummyFrontend{t}, testCtxt)
return NewConfig("amd64", DummyFrontend{t}, testCtxt, true)
}
// DummyFrontend is a test-only frontend.