Only ld/sd "needed"
This commit is contained in:
parent
4c7a2c85a2
commit
7479ee19d8
@ -18,12 +18,12 @@ class AllInMemAllocator(Allocator):
|
||||
s_index = 0
|
||||
for arg in old_instr.args():
|
||||
if isinstance(arg, Temporary):
|
||||
# TODO: don't ld/sd when nothing changed (eg don't ld a destination only,
|
||||
# TODO: don't sd a source only)
|
||||
s_index += 1
|
||||
if arg in old_instr.used(): # needs to be read first
|
||||
before.append(RiscV.ld(
|
||||
S[s_index], arg.get_alloced_loc()
|
||||
))
|
||||
if arg in old_instr.defined(): # needs to be stored after
|
||||
after.append(RiscV.sd(
|
||||
S[s_index], arg.get_alloced_loc()
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user