regalloc: removes unused Instr.AddedBeforeRegAlloc api (#2268)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2024-06-25 10:14:12 -07:00
committed by GitHub
parent 8db4d0fbc1
commit 200980ef11
6 changed files with 4 additions and 17 deletions

View File

@@ -26,9 +26,6 @@ func (i *instruction) IsIndirectCall() bool { return i.kind == callIndirect }
// IsReturn implements regalloc.Instr.
func (i *instruction) IsReturn() bool { return i.kind == ret }
// AddedBeforeRegAlloc implements regalloc.Instr.
func (i *instruction) AddedBeforeRegAlloc() bool { return i.addedBeforeRegAlloc }
// String implements regalloc.Instr.
func (i *instruction) String() string {
switch i.kind {

View File

@@ -165,7 +165,7 @@ func (pos *labelPosition) InstrIteratorNext() *instruction {
pos.cur = instr
if instr == nil {
return nil
} else if instr.AddedBeforeRegAlloc() {
} else if instr.addedBeforeRegAlloc {
// Only concerned about the instruction added before regalloc.
return instr
}
@@ -188,7 +188,7 @@ func (pos *labelPosition) InstrRevIteratorNext() *instruction {
pos.cur = instr
if instr == nil {
return nil
} else if instr.AddedBeforeRegAlloc() {
} else if instr.addedBeforeRegAlloc {
// Only concerned about the instruction added before regalloc.
return instr
}

View File

@@ -51,11 +51,6 @@ func (i *instruction) IsReturn() bool {
return i.kind == ret
}
// AddedBeforeRegAlloc implements regalloc.Instr AddedBeforeRegAlloc.
func (i *instruction) AddedBeforeRegAlloc() bool {
return i.addedBeforeRegAlloc
}
type defKind byte
const (

View File

@@ -167,7 +167,7 @@ func (pos *labelPosition) InstrIteratorNext() *instruction {
pos.cur = instr
if instr == nil {
return nil
} else if instr.AddedBeforeRegAlloc() {
} else if instr.addedBeforeRegAlloc {
// Only concerned about the instruction added before regalloc.
return instr
}
@@ -190,7 +190,7 @@ func (pos *labelPosition) InstrRevIteratorNext() *instruction {
pos.cur = instr
if instr == nil {
return nil
} else if instr.AddedBeforeRegAlloc() {
} else if instr.addedBeforeRegAlloc {
// Only concerned about the instruction added before regalloc.
return instr
}

View File

@@ -120,7 +120,5 @@ type (
IsIndirectCall() bool
// IsReturn returns true if this instruction is a return instruction.
IsReturn() bool
// AddedBeforeRegAlloc returns true if this instruction is added before register allocation.
AddedBeforeRegAlloc() bool
}
)

View File

@@ -266,9 +266,6 @@ func (m *mockInstr) Defs(ret *[]VReg) []VReg {
return *ret
}
// AddedBeforeRegAlloc implements Instr.
func (m *mockInstr) AddedBeforeRegAlloc() bool { return true }
// Uses implements Instr.
func (m *mockInstr) Uses(ret *[]VReg) []VReg {
*ret = append((*ret)[:0], m.uses...)