TP05b : Don't do unnecessary moves, that breaks everything
This commit is contained in:
parent
d668ab98aa
commit
d91c1df685
@ -22,7 +22,6 @@ def generate_smart_move(dest: DataLocation, src: DataLocation) -> List[BlockInst
|
||||
|
||||
match dest, src:
|
||||
case Register(), Register():
|
||||
if dest != src:
|
||||
instr.append(RiscV.mv(dest, src))
|
||||
case Register(), Offset():
|
||||
instr.append(RiscV.ld(dest, src))
|
||||
@ -70,6 +69,8 @@ def sequentialize_moves(parallel_moves: Set[Tuple[DataLocation, DataLocation]]
|
||||
# Then handle the cycles
|
||||
cycles: List = move_graph.connected_components()
|
||||
for cycle in cycles:
|
||||
if len(cycle) == 1:
|
||||
continue
|
||||
previous = tmp
|
||||
for var in reversed(cycle):
|
||||
moves.append((previous, var))
|
||||
|
Loading…
Reference in New Issue
Block a user