Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
peephole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
peephole
Commits
af811f6e
Commit
af811f6e
authored
Dec 28, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic whitespace fix.
parent
06bb955c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/optimize.py
src/optimize.py
+3
-3
No files found.
src/optimize.py
View file @
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'
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment