regalloc: use less memory in liveness analysis (#2262)
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
@@ -432,7 +432,7 @@ func (a *Allocator) livenessAnalysis(f Function) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, st := range succInfo.liveIns {
|
for _, st := range succInfo.liveIns {
|
||||||
if st.phiBlk() != succ {
|
if st.phiBlk() != succ && st.spilled != flagLive { //nolint:gosimple
|
||||||
// We use .spilled field to store the flag.
|
// We use .spilled field to store the flag.
|
||||||
st.spilled = flagLive
|
st.spilled = flagLive
|
||||||
a.ss = append(a.ss, st)
|
a.ss = append(a.ss, st)
|
||||||
@@ -448,17 +448,18 @@ func (a *Allocator) livenessAnalysis(f Function) {
|
|||||||
if !def.IsRealReg() {
|
if !def.IsRealReg() {
|
||||||
st := s.getOrAllocateVRegState(def)
|
st := s.getOrAllocateVRegState(def)
|
||||||
defIsPhi = st.isPhi
|
defIsPhi = st.isPhi
|
||||||
// We use .spilled field to store the flag.
|
// Note: We use .spilled field to store the flag.
|
||||||
st.spilled = flagDeleted
|
st.spilled = flagDeleted
|
||||||
a.ss = append(a.ss, st)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, use = range instr.Uses(&a.vs) {
|
for _, use = range instr.Uses(&a.vs) {
|
||||||
if !use.IsRealReg() {
|
if !use.IsRealReg() {
|
||||||
st := s.getOrAllocateVRegState(use)
|
st := s.getOrAllocateVRegState(use)
|
||||||
// We use .spilled field to store the flag.
|
// Note: We use .spilled field to store the flag.
|
||||||
st.spilled = flagLive
|
if st.spilled != flagLive { //nolint:gosimple
|
||||||
a.ss = append(a.ss, st)
|
st.spilled = flagLive
|
||||||
|
a.ss = append(a.ss, st)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user