@@ -9,40 +9,37 @@ import (
9
9
"cmd/internal/obj"
10
10
"cmd/internal/objabi"
11
11
"cmd/internal/src"
12
- "os"
13
- "strconv"
14
12
)
15
13
16
14
// A Config holds readonly compilation information.
17
15
// It is created once, early during compilation,
18
16
// and shared across all compilations.
19
17
type Config struct {
20
- arch string // "amd64", etc.
21
- PtrSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.PtrSize
22
- RegSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.RegSize
23
- Types Types
24
- lowerBlock blockRewriter // lowering function
25
- lowerValue valueRewriter // lowering function
26
- registers []Register // machine registers
27
- gpRegMask regMask // general purpose integer register mask
28
- fpRegMask regMask // floating point register mask
29
- specialRegMask regMask // special register mask
30
- GCRegMap []* Register // garbage collector register map, by GC register index
31
- FPReg int8 // register number of frame pointer, -1 if not used
32
- LinkReg int8 // register number of link register if it is a general purpose register, -1 if not used
33
- hasGReg bool // has hardware g register
34
- ctxt * obj.Link // Generic arch information
35
- optimize bool // Do optimization
36
- noDuffDevice bool // Don't use Duff's device
37
- useSSE bool // Use SSE for non-float operations
38
- useAvg bool // Use optimizations that need Avg* operations
39
- useHmul bool // Use optimizations that need Hmul* operations
40
- nacl bool // GOOS=nacl
41
- use387 bool // GO386=387
42
- SoftFloat bool //
43
- NeedsFpScratch bool // No direct move between GP and FP register sets
44
- BigEndian bool //
45
- sparsePhiCutoff uint64 // Sparse phi location algorithm used above this #blocks*#variables score
18
+ arch string // "amd64", etc.
19
+ PtrSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.PtrSize
20
+ RegSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.RegSize
21
+ Types Types
22
+ lowerBlock blockRewriter // lowering function
23
+ lowerValue valueRewriter // lowering function
24
+ registers []Register // machine registers
25
+ gpRegMask regMask // general purpose integer register mask
26
+ fpRegMask regMask // floating point register mask
27
+ specialRegMask regMask // special register mask
28
+ GCRegMap []* Register // garbage collector register map, by GC register index
29
+ FPReg int8 // register number of frame pointer, -1 if not used
30
+ LinkReg int8 // register number of link register if it is a general purpose register, -1 if not used
31
+ hasGReg bool // has hardware g register
32
+ ctxt * obj.Link // Generic arch information
33
+ optimize bool // Do optimization
34
+ noDuffDevice bool // Don't use Duff's device
35
+ useSSE bool // Use SSE for non-float operations
36
+ useAvg bool // Use optimizations that need Avg* operations
37
+ useHmul bool // Use optimizations that need Hmul* operations
38
+ nacl bool // GOOS=nacl
39
+ use387 bool // GO386=387
40
+ SoftFloat bool //
41
+ NeedsFpScratch bool // No direct move between GP and FP register sets
42
+ BigEndian bool //
46
43
}
47
44
48
45
type (
@@ -360,22 +357,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
360
357
opcodeTable [Op386LoweredWB ].reg .clobbers |= 1 << 3 // BX
361
358
}
362
359
363
- // cutoff is compared with product of numblocks and numvalues,
364
- // if product is smaller than cutoff, use old non-sparse method.
365
- // cutoff == 0 implies all sparse.
366
- // cutoff == -1 implies none sparse.
367
- // Good cutoff values seem to be O(million) depending on constant factor cost of sparse.
368
- // TODO: get this from a flag, not an environment variable
369
- c .sparsePhiCutoff = 2500000 // 0 for testing. // 2500000 determined with crude experiments w/ make.bash
370
- ev := os .Getenv ("GO_SSA_PHI_LOC_CUTOFF" )
371
- if ev != "" {
372
- v , err := strconv .ParseInt (ev , 10 , 64 )
373
- if err != nil {
374
- ctxt .Diag ("Environment variable GO_SSA_PHI_LOC_CUTOFF (value '%s') did not parse as a number" , ev )
375
- }
376
- c .sparsePhiCutoff = uint64 (v ) // convert -1 to maxint, for never use sparse
377
- }
378
-
379
360
// Create the GC register map index.
380
361
// TODO: This is only used for debug printing. Maybe export config.registers?
381
362
gcRegMapSize := int16 (0 )
@@ -399,5 +380,4 @@ func (c *Config) Set387(b bool) {
399
380
c .use387 = b
400
381
}
401
382
402
- func (c * Config ) SparsePhiCutoff () uint64 { return c .sparsePhiCutoff }
403
- func (c * Config ) Ctxt () * obj.Link { return c .ctxt }
383
+ func (c * Config ) Ctxt () * obj.Link { return c .ctxt }
0 commit comments