pass: naive implementation of liveness

This commit is contained in:
Michael McLoughlin
2018-12-02 23:59:29 -08:00
parent 7d4e18f4f4
commit b52c67f3fb
8 changed files with 1093 additions and 1000 deletions

6
ast.go
View File

@@ -45,9 +45,13 @@ type Instruction struct {
// CFG.
Pred []*Instruction
Succ []*Instruction
// LiveIn/LiveOut are sets of live register IDs pre/post execution.
LiveIn map[reg.ID]bool
LiveOut map[reg.ID]bool
}
func (i Instruction) node() {}
func (i *Instruction) node() {}
func (i Instruction) TargetLabel() *Label {
if !i.IsBranch {