mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: don't run gc/ssa_test/TestGenFlowGraph in short mode
The test runs far too long for -short mode (4 seconds). Also removed useless test of now-disconnected knob (GO_SSA_PHI_LOC_CUTOFF), which cuts 4 seconds to 2 seconds (which is still too long), and finished removing the disconnected knob. Updates #26469. Change-Id: I6c594227c4a5aaffee46832049bdbbf570d86e60 Reviewed-on: https://go-review.googlesource.com/125075 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
ad705baafd
commit
0b3d39c700
2 changed files with 29 additions and 50 deletions
|
|
@ -11,7 +11,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
@ -99,10 +98,10 @@ func runGenTest(t *testing.T, filename, tmpname string, ev ...string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGenFlowGraph(t *testing.T) {
|
func TestGenFlowGraph(t *testing.T) {
|
||||||
runGenTest(t, "flowgraph_generator1.go", "ssa_fg_tmp1")
|
if testing.Short() {
|
||||||
if runtime.GOOS != "windows" {
|
t.Skip("not run in short mode.")
|
||||||
runGenTest(t, "flowgraph_generator1.go", "ssa_fg_tmp2", "GO_SSA_PHI_LOC_CUTOFF=0")
|
|
||||||
}
|
}
|
||||||
|
runGenTest(t, "flowgraph_generator1.go", "ssa_fg_tmp1")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestShortCircuit tests OANDAND and OOROR expressions and short circuiting.
|
// TestShortCircuit tests OANDAND and OOROR expressions and short circuiting.
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ import (
|
||||||
"cmd/internal/obj"
|
"cmd/internal/obj"
|
||||||
"cmd/internal/objabi"
|
"cmd/internal/objabi"
|
||||||
"cmd/internal/src"
|
"cmd/internal/src"
|
||||||
"os"
|
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Config holds readonly compilation information.
|
// A Config holds readonly compilation information.
|
||||||
|
|
@ -42,7 +40,6 @@ type Config struct {
|
||||||
SoftFloat bool //
|
SoftFloat bool //
|
||||||
NeedsFpScratch bool // No direct move between GP and FP register sets
|
NeedsFpScratch bool // No direct move between GP and FP register sets
|
||||||
BigEndian bool //
|
BigEndian bool //
|
||||||
sparsePhiCutoff uint64 // Sparse phi location algorithm used above this #blocks*#variables score
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
@ -360,22 +357,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
||||||
opcodeTable[Op386LoweredWB].reg.clobbers |= 1 << 3 // BX
|
opcodeTable[Op386LoweredWB].reg.clobbers |= 1 << 3 // BX
|
||||||
}
|
}
|
||||||
|
|
||||||
// cutoff is compared with product of numblocks and numvalues,
|
|
||||||
// if product is smaller than cutoff, use old non-sparse method.
|
|
||||||
// cutoff == 0 implies all sparse.
|
|
||||||
// cutoff == -1 implies none sparse.
|
|
||||||
// Good cutoff values seem to be O(million) depending on constant factor cost of sparse.
|
|
||||||
// TODO: get this from a flag, not an environment variable
|
|
||||||
c.sparsePhiCutoff = 2500000 // 0 for testing. // 2500000 determined with crude experiments w/ make.bash
|
|
||||||
ev := os.Getenv("GO_SSA_PHI_LOC_CUTOFF")
|
|
||||||
if ev != "" {
|
|
||||||
v, err := strconv.ParseInt(ev, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
ctxt.Diag("Environment variable GO_SSA_PHI_LOC_CUTOFF (value '%s') did not parse as a number", ev)
|
|
||||||
}
|
|
||||||
c.sparsePhiCutoff = uint64(v) // convert -1 to maxint, for never use sparse
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the GC register map index.
|
// Create the GC register map index.
|
||||||
// TODO: This is only used for debug printing. Maybe export config.registers?
|
// TODO: This is only used for debug printing. Maybe export config.registers?
|
||||||
gcRegMapSize := int16(0)
|
gcRegMapSize := int16(0)
|
||||||
|
|
@ -399,5 +380,4 @@ func (c *Config) Set387(b bool) {
|
||||||
c.use387 = b
|
c.use387 = b
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) SparsePhiCutoff() uint64 { return c.sparsePhiCutoff }
|
|
||||||
func (c *Config) Ctxt() *obj.Link { return c.ctxt }
|
func (c *Config) Ctxt() *obj.Link { return c.ctxt }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue