mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile: initial implementation of likely direction
Change-Id: Id8457b18c07bf717d13c9423d8f314f253eee64f Reviewed-on: https://go-review.googlesource.com/13580 Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
212a1763fc
commit
bbf8c5ce2f
7 changed files with 84 additions and 8 deletions
|
|
@ -47,7 +47,21 @@ blockloop:
|
|||
|
||||
// Pick the next block to schedule
|
||||
// Pick among the successor blocks that have not been scheduled yet.
|
||||
// Just use degree for now. TODO(khr): use likely direction hints.
|
||||
|
||||
// Use likely direction if we have it.
|
||||
var likely *Block
|
||||
switch b.Likely {
|
||||
case BranchLikely:
|
||||
likely = b.Succs[0]
|
||||
case BranchUnlikely:
|
||||
likely = b.Succs[1]
|
||||
}
|
||||
if likely != nil && !scheduled[likely.ID] {
|
||||
bid = likely.ID
|
||||
continue
|
||||
}
|
||||
|
||||
// Use degree for now.
|
||||
bid = 0
|
||||
mindegree := f.NumBlocks()
|
||||
for _, c := range order[len(order)-1].Succs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue