Commit 77412c47 authored by Jayke Meijer's avatar Jayke Meijer

Merge branch 'master' of github.com:taddeus/peephole

parents 941ce4df af811f6e
...@@ -35,10 +35,10 @@ def optimize_blocks(blocks): ...@@ -35,10 +35,10 @@ def optimize_blocks(blocks):
"""Call the optimizer for each basic block. Do this several times until """Call the optimizer for each basic block. Do this several times until
no more optimizations are achieved.""" no more optimizations are achieved."""
optimized = [] optimized = []
for block in blocks: for block in blocks:
optimize_block(block) optimize_block(block)
return blocks return blocks
...@@ -106,7 +106,7 @@ def optimize_block(statements): ...@@ -106,7 +106,7 @@ def optimize_block(statements):
lw[-1] = str(s[2]) + lw[-1][1:] lw[-1] = str(s[2]) + lw[-1][1:]
statements.replace(2, [lw]) statements.replace(2, [lw])
continue continue
# move $RegA, $RegB -> move $RegA, $RegB # move $RegA, $RegB -> move $RegA, $RegB
# move $RegB, $RegA # move $RegB, $RegA
if s.is_command('move'): if s.is_command('move'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment