mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile/internal/ssa: New register allocator
Implement a global (whole function) register allocator. This replaces the local (per basic block) register allocator. Clobbering of registers by instructions is handled properly. A separate change will add the correct clobbers to all the instructions. Change-Id: I38ce4dc7dccb8303c1c0e0295fe70247b0a3f2ea Reviewed-on: https://go-review.googlesource.com/13622 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Todd Neal <todd@tneal.org>
This commit is contained in:
parent
759b9c3b80
commit
0b46b42943
12 changed files with 1447 additions and 750 deletions
|
|
@ -59,6 +59,14 @@ func findlive(f *Func) (reachable []bool, live []bool) {
|
|||
|
||||
// deadcode removes dead code from f.
|
||||
func deadcode(f *Func) {
|
||||
// deadcode after regalloc is forbidden for now. Regalloc
|
||||
// doesn't quite generate legal SSA which will lead to some
|
||||
// required moves being eliminated. See the comment at the
|
||||
// top of regalloc.go for details.
|
||||
if f.RegAlloc != nil {
|
||||
f.Fatalf("deadcode after regalloc")
|
||||
}
|
||||
|
||||
reachable, live := findlive(f)
|
||||
|
||||
// Remove dead values from blocks' value list. Return dead
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue