Skip to content

Commit e6051de

Browse files
committed
cmd/compile: lower cse comparison depth
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent fa49c39 commit e6051de

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/compile/internal/ssa

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/ssa/cse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
const (
13-
cmpDepth = 4
13+
cmpDepth = 1
1414
)
1515

1616
// cse does common-subexpression elimination on the Function.

0 commit comments

Comments
 (0)