Skip to content
Snippets Groups Projects
Commit 469a6f8f authored by Jayke Meijer's avatar Jayke Meijer
Browse files

Fixed faulty function call in init of optimize module

parent b279082a
No related branches found
No related tags found
No related merge requests found
*.s
...@@ -180,7 +180,6 @@ $L5: ...@@ -180,7 +180,6 @@ $L5:
addu $3,$16,$17 addu $3,$16,$17
addu $2,$3,$2 addu $2,$3,$2
sw $2,24($fp) sw $2,24($fp)
lw $2,24($fp)
beq $2,$0,$L8 beq $2,$0,$L8
lw $2,24($fp) lw $2,24($fp)
li $3,0x00000003 # 3 li $3,0x00000003 # 3
...@@ -410,4 +409,4 @@ $L27: ...@@ -410,4 +409,4 @@ $L27:
lw $fp,24($sp) lw $fp,24($sp)
addu $sp,$sp,32 addu $sp,$sp,32
j $31 j $31
.end main .end main
\ No newline at end of file
...@@ -3,7 +3,7 @@ from src.dataflow import find_basic_blocks ...@@ -3,7 +3,7 @@ from src.dataflow import find_basic_blocks
from redundancies import remove_redundant_jumps, move_1, move_2, move_3, \ from redundancies import remove_redundant_jumps, move_1, move_2, move_3, \
move_4, load, shift, add move_4, load, shift, add
from advanced import eliminate_common_subexpressions, fold_constants, \ from advanced import eliminate_common_subexpressions, fold_constants, \
copy_propagation copy_propagation, algebraic_transformations
def remove_redundancies(block): def remove_redundancies(block):
...@@ -31,7 +31,8 @@ def optimize_block(block): ...@@ -31,7 +31,8 @@ def optimize_block(block):
while remove_redundancies(block) \ while remove_redundancies(block) \
| eliminate_common_subexpressions(block) \ | eliminate_common_subexpressions(block) \
| fold_constants(block) \ | fold_constants(block) \
| copy_propagation(block): | copy_propagation(block)\
| algebraic_transformations(block):
pass pass
...@@ -40,7 +41,7 @@ def optimize(statements, verbose=0): ...@@ -40,7 +41,7 @@ def optimize(statements, verbose=0):
optimization functions.""" optimization functions."""
# Optimize on a global level # Optimize on a global level
o = len(statements) o = len(statements)
optimize_global(statements) remove_redundant_jumps(statements)
g = len(statements) g = len(statements)
# Optimize basic blocks # Optimize basic blocks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment