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,40 +9,37 @@ 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.
|
||||||
// It is created once, early during compilation,
|
// It is created once, early during compilation,
|
||||||
// and shared across all compilations.
|
// and shared across all compilations.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
arch string // "amd64", etc.
|
arch string // "amd64", etc.
|
||||||
PtrSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.PtrSize
|
PtrSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.PtrSize
|
||||||
RegSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.RegSize
|
RegSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.RegSize
|
||||||
Types Types
|
Types Types
|
||||||
lowerBlock blockRewriter // lowering function
|
lowerBlock blockRewriter // lowering function
|
||||||
lowerValue valueRewriter // lowering function
|
lowerValue valueRewriter // lowering function
|
||||||
registers []Register // machine registers
|
registers []Register // machine registers
|
||||||
gpRegMask regMask // general purpose integer register mask
|
gpRegMask regMask // general purpose integer register mask
|
||||||
fpRegMask regMask // floating point register mask
|
fpRegMask regMask // floating point register mask
|
||||||
specialRegMask regMask // special register mask
|
specialRegMask regMask // special register mask
|
||||||
GCRegMap []*Register // garbage collector register map, by GC register index
|
GCRegMap []*Register // garbage collector register map, by GC register index
|
||||||
FPReg int8 // register number of frame pointer, -1 if not used
|
FPReg int8 // register number of frame pointer, -1 if not used
|
||||||
LinkReg int8 // register number of link register if it is a general purpose register, -1 if not used
|
LinkReg int8 // register number of link register if it is a general purpose register, -1 if not used
|
||||||
hasGReg bool // has hardware g register
|
hasGReg bool // has hardware g register
|
||||||
ctxt *obj.Link // Generic arch information
|
ctxt *obj.Link // Generic arch information
|
||||||
optimize bool // Do optimization
|
optimize bool // Do optimization
|
||||||
noDuffDevice bool // Don't use Duff's device
|
noDuffDevice bool // Don't use Duff's device
|
||||||
useSSE bool // Use SSE for non-float operations
|
useSSE bool // Use SSE for non-float operations
|
||||||
useAvg bool // Use optimizations that need Avg* operations
|
useAvg bool // Use optimizations that need Avg* operations
|
||||||
useHmul bool // Use optimizations that need Hmul* operations
|
useHmul bool // Use optimizations that need Hmul* operations
|
||||||
nacl bool // GOOS=nacl
|
nacl bool // GOOS=nacl
|
||||||
use387 bool // GO386=387
|
use387 bool // GO386=387
|
||||||
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