]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: lower cse comparison depth
authorKeith Randall <khr@golang.org>
Tue, 4 Oct 2016 17:01:48 +0000 (10:01 -0700)
committerKeith Randall <khr@golang.org>
Tue, 4 Oct 2016 19:35:56 +0000 (19:35 +0000)
Todd originally set cmpDepth to 4.  Quoting:

I picked a depth of 4 by timing tests of `go tool compile arithConst_ssa.go` and `go test -c net/http`.

    3.89 / 3.92  CL w/cmpDepth = 1
    3.78 / 3.92  CL w/cmpDepth = 2
    3.44 / 3.96  CL w/cmpDepth = 3
    3.29 / 3.9   CL w/cmpDepth = 4
    3.3  / 3.93  CL w/cmpDepth = 5
    3.29 / 3.92  CL w/cmpDepth = 10

I don't see the same behavior now, differences in those two benchmarks
are in the noise (between 1 and 4).

In issue 17127, CSE takes a really long time.  Lowering cmpDepth
from 4 to 1 lowers compile time from 8 minutes to 1 minute.

Fixes #17127

Change-Id: I6dc544bbcf2a9dca73637d0182d3de1a5ae6c944
Reviewed-on: https://go-review.googlesource.com/30257
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/cse.go

index 795950e75d05a08ef6193c0389a92bbba143c7fb..532232de57c9783164cd934a6448028be519ba43 100644 (file)
@@ -10,7 +10,7 @@ import (
 )
 
 const (
-       cmpDepth = 4
+       cmpDepth = 1
 )
 
 // cse does common-subexpression elimination on the Function.