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
8b0656ec
Commit
8b0656ec
authored
Dec 31, 2011
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Almost-finished report.
parent
c7080a74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
13 deletions
+78
-13
report/report.tex
report/report.tex
+78
-13
No files found.
report/report.tex
View file @
8b0656ec
...
...
@@ -251,7 +251,51 @@ Our code is provided with this report, and is also available on GitHub: \\
\subsection
{
Structure
}
% TODO
The folder structure of out implementation is as follows:
\begin
{
itemize
}
\item
\texttt
{
.
}
\begin
{
itemize
}
\item
\texttt
{
benchmarks
/
}
\\
All benchmark files and their assembly versions
(
both unoptimized and
optimized
)
.
\item
\texttt
{
src
/
}
\begin
{
itemize
}
\item
\texttt
{
copy
\_
propagation.py
}
\\
\texttt
{
liveness.py
}
\\
\texttt
{
reaching
\_
definitions.py
}
\\
Implementation of specific dataflow problems.
\item
\texttt
{
dag.py
}
\\
DAG creation
(
unused
)
.
\item
\texttt
{
dataflow.py
}
\\
Common dataflow functions such as basic block
-
division and flow
graph generation. Contains definition of
\texttt
{
BasicBlock
}
class.
\item
\texttt
{
dominator.py
}
\\
Dominator tree creation
(
unused, untested
)
.
\item
\texttt
{
optimize
\_
advanced.py
}
\\
Advanced optimizations on basic block
-
level: Common subexpression
elimination, constant folding, copy propagation and dead code
elimination.
\item
\texttt
{
optimize
\_
redundancies.py
}
\\
Straight
-
forward replacement functions for statement sequences on
global
-
and basic block
-
level.
\item
\texttt
{
parser.py
}
\\
Assembly parser.
\item
\texttt
{
program.py
}
\\
Definition of
\texttt
{
Program
}
class.
\item
\texttt
{
statement.py
}
\\
Definition of
\texttt
{
Statement
}
and
\texttt
{
Block
}
classes.
\item
\texttt
{
writer.py
}
\\
Assembly writer.
\end
{
itemize
}
\item
\texttt
{
tests
/
}
\\
Unit tests.
\item
\texttt
{
main.py
}
\\
Runs the optimizer.
\item
\texttt
{
run
}
\\
Runs the optimizer and compares original statement list to the
optimized one.
\end
{
itemize
}
\end
{
itemize
}
\subsection
{
Parsing
}
...
...
@@ -309,12 +353,29 @@ non-optimized files.
\subsection
{
Execution
}
To execute the optimizer, the following command can be given:
\\
\texttt
{
.
/
main.py <original file> <optimized file> <rewritten original file>
}
\\
There is also a script available that runs the optimizer and automatically
starts the program
\emph
{
meld
}
. In meld it is easy to visually compare the
original file and the optimized file. The command to execute this script is:
\\
\texttt
{
.
/
run <benchmark name
(
e.g. whet
)
>
}
The main execution file
(
\emph
{
main.py
}
)
is located in the root directory. It
takes the file to be optimized as last argument, optionally preceded by one or
more of the following options:
\begin
{
itemize
}
\item
\texttt
{
-
o OUT
\_
FILE
}
Location to save the optimized statement list.
\item
\texttt
{
-
i SOURCE
\_
OUT
\_
FILE
}
Location to save the original statement list.
\item
\texttt
{
-
v VERBOSE
\_
LEVEL
}
The optimizer's verbose level
(
default
1
)
.
\\
Possible verbose levels are:
\\
0
: No command
-
line output, no comments in output file.
\\
1
: Results in command
-
line output, inline optimization comments in
output file.
\\
2
: Results and debug statements in command
-
line output, inline
optimization comments in output file.
\\
\end
{
itemize
}
The root directory also contains an executable script:
\texttt
{
run
}
. This
script calls
\texttt
{
main.py
}
and automatically starts the program
\texttt
{
meld
}
. In
\texttt
{
meld
}
it is easy to visually compare the original
file and the optimized file. The usage of this script is as follows:
\\
\texttt
{
.
/
run <benchmark name
(
e.g. whet
)
>
[
<verbose level>
]
}
\section
{
Testing
}
...
...
@@ -341,17 +402,20 @@ been unit tested. To make this report, the command \texttt{make coverage} can
be run in the root folder. The report is than added as a folder
\emph
{
coverage
}
in which a
\emph
{
index.html
}
can be used to see the entire report.
\subsection
{
Ouput comparison
}
\subsection
{
Ou
t
put comparison
}
In order to check whether the optimization does not change the function
ing
of
the program, the output of the provided benchmark programs
has to be compared
t
o the output after optimization. If any of these outputs i
s not equal to the
original output, our optimizations are to aggressive, or there is a bug
In order to check whether the optimization does not change the function
ality
of
the program, the output of the provided benchmark programs
was compared to
t
heir output after optimization. If any of these outputs wa
s not equal to the
original output,
either
our optimizations are to aggressive, or there is a bug
somewhere in the code.
\section
{
Results
}
The following results have been obtained:
\\
We have executed the optimizer on each of the benchmark files and compared the
number of execution cycles of the optimized versions vs. the original versions.
The results are displayed in the following table:
\\
\\
\begin
{
tabular
}{
|c|c|c|c|c|c|
}
\hline
Benchmark
&
Original
&
Removed
&
Original
&
Optimized
&
Performance
\\
...
...
@@ -366,6 +430,7 @@ clinpack & 3523 & & & & \%
\hline
\end
{
tabular
}
\begin
{
tabular
}{
|c|c|c|c|c|c|
}
\hline
Benchmark
&
Original
&
Removed
&
Original
&
Optimized
&
Performance
\\
...
...
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