moving to SA register names (wip)

starting to implement register allocation by first creating SA
Single Assignment means a register is only every assigned a value once. Hence for any operation involving another register, a new register is created.
We do this with a naming scheme for the registers in dot notation (as it would be in c) which means 2 registers with the same name, should have the same contents. This does not apply to temporaries, but that is another day.
Starting WIP now, and will create many red commits before merging when green.
This commit is contained in:
2020-02-29 17:16:52 +02:00
parent f2c853821c
commit 0ce14bdfd1
4 changed files with 36 additions and 29 deletions

View File

@ -27,12 +27,14 @@ module Risc
def resolve_type(name)
Parfait.object_space.types.values.first
end
def use_reg(type , extra = {})
RegisterValue.new(:r1 , type)
end
def reset_regs
end
def add_constant(c)
end
end
class RegisterValue
def is_object?
@symbol.to_s.start_with?("id_")
end
end
end