Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132package codegen
import ( "slices"
"git.urbach.dev/cli/q/src/cpu")
// phiMoveClobbered returns the destinations of phi moves.func phiMoveClobbered(step *Step) []cpu.Register { var clobbered []cpu.Register
for _, live := range step.Live { for phi := range live.Phis.All() { if live.Register == phi.Register { continue }
if slices.Contains(clobbered, phi.Register) { continue }
if !slices.Contains(phi.Block.Predecessors, step.Block) { continue }
clobbered = append(clobbered, phi.Register) } }
return clobbered}