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
f1794b62
Commit
f1794b62
authored
Dec 28, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:taddeus/peephole
parents
cbd8597b
7b0de9af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
report/report.tex
report/report.tex
+9
-8
src/optimize/advanced.py
src/optimize/advanced.py
+7
-0
No files found.
report/report.tex
View file @
f1794b62
...
@@ -106,14 +106,15 @@ implementation is a slightly less fancy, but easier to implement.
...
@@ -106,14 +106,15 @@ implementation is a slightly less fancy, but easier to implement.
We search from the end of the block up for instructions that are eligible for
We search from the end of the block up for instructions that are eligible for
CSE. If we find one, we check further up in the code for the same instruction,
CSE. If we find one, we check further up in the code for the same instruction,
and add that to a temporary storage list. This is done until the beginning of
and add that to a temporary storage list. This is done until the beginning of
the block or until one of the arguments of this expression is assigned. Now all
the block or until one of the arguments of this expression is assigned.
occurrences of this expression can be replaced by a move of a new variable that
is generated above the first occurrence, which contains the value of the
expression.
This is a less efficient method, but because the basic blocks are in general
We now add the instruction above the first use, and write the result in a new
not very large and the execution time of the optimizer is not a primary
variable. Then all occurrences of this expression can be replaced by a move of
concern, this is not a big problem.
from new variable into the original destination variable of the instruction.
This is a less efficient method then the dag, but because the basic blocks are
in general not very large and the execution time of the optimizer is not a
primary concern, this is not a big problem.
\section
{
Implementation
}
\section
{
Implementation
}
...
@@ -201,7 +202,7 @@ $Lx: ...
...
@@ -201,7 +202,7 @@ $Lx: ...
j
$
Ly
-
>
$
Lx: ...
j
$
Ly
-
>
$
Lx: ...
$
Lx: ...
$
Lx: ...
\end
{
verbatim
}
\end
{
verbatim
}
\textbf
{
S
imple
basic block optimizations
}
\textbf
{
S
tandard
basic block optimizations
}
\begin
{
verbatim
}
\begin
{
verbatim
}
mov
$
regA,
$
regA
-
>
---
//
remove it
mov
$
regA,
$
regA
-
>
---
//
remove it
...
...
src/optimize/advanced.py
View file @
f1794b62
...
@@ -91,3 +91,10 @@ def fold_constants(block):
...
@@ -91,3 +91,10 @@ def fold_constants(block):
#else:
#else:
return
False
return
False
def
copy_propagtion
(
block
):
"""
Rename values that were copied to there original, so the copy statement
might be useless, allowing it to be removed by dead code elimination.
"""
return
false
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