www: Update matmul example slightly.

llvm-svn: 154952
This commit is contained in:
Tobias Grosser 2012-04-17 21:38:20 +00:00
parent 37f6dcb3a8
commit 105c984b51
6 changed files with 23 additions and 24 deletions

View File

@ -22,9 +22,9 @@ which analysis is performed or what transformation is applied. In this example
the polyhedral transformation is user-provided to show how much performance
improvement can be expected by an optimal automatic optimizer.</p>
The files used and created in this example are available <a
href="experiments/matmul">here</a>. They can be created automatically by running
the <a href="experiments/matmul/runall.sh">runall.sh</a> script.
The files used and created in this example are available in the Polly checkout
in the folder <em>www/experiments/matmul</em>. They can be created automatically
by running the <em>www/experiments/matmul/runall.sh</em> script.
<ol>
<li><h4>Create LLVM-IR from the C code</h4>
@ -57,7 +57,7 @@ the LLVM-IR into this form we use a set of canonicalication passes. For this
example only three passes are necessary. To get good coverage on more
complicated input files often more canonicalization passes are needed. pollycc
contains a list of passes that have shown to be beneficial.
<pre class="code">opt -S -mem2reg -loop-simplify -indvars matmul.s &gt; matmul.preopt.ll</pre></li>
<pre class="code">opt -S -mem2reg -loop-simplify -polly-indvars matmul.s &gt; matmul.preopt.ll</pre></li>
<li><h4>Show the SCoPs detected by Polly (optional)</h4>
@ -232,9 +232,8 @@ changed. These changed schedules are used to descripe transformations.
It is possible to import different jscop files by providing the postfix
of the jscop file that is imported.</p>
<p> We apply three different transformations on the SCoP in the main function.
The jscop files describing these transformations are hand written. If PoCC is
installed Polly can sometimes calculate such schedules fully automatically.
Hwever, this is still an area we are actively working on.</p>
The jscop files describing these transformations are hand written (and available
in <em>www/experiments/matmul</em>).
<h5>No Polly</h5>

View File

@ -1,5 +1,5 @@
{
"context" : "{ [] }",
"context" : "{ : }",
"name" : "%1 => %17",
"statements" : [
{

View File

@ -6,7 +6,7 @@
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_4[i0, i1] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_4[i0, i1] -> MemRef_C[1536i0 + i1] }"
}
],
"domain" : "{ Stmt_4[i0, i1] : i0 >= 0 and i0 <= 1023 and i1 >= 0 and i1 <= 1023 }",
@ -17,19 +17,19 @@
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1536i0 + i1] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_A[1037i0 + i2] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_A[1536i0 + i2] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_B[i1 + 1047i2] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_B[i1 + 1536i2] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1536i0 + i1] }"
}
],
"domain" : "{ Stmt_6[i0, i1, i2] : i0 >= 0 and i0 <= 1023 and i1 >= 0 and i1 <= 1023 and i2 >= 0 and i2 <= 1023 }",

View File

@ -6,7 +6,7 @@
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_4[i0, i1] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_4[i0, i1] -> MemRef_C[1536i0 + i1] }"
}
],
"domain" : "{ Stmt_4[i0, i1] : i0 >= 0 and i0 <= 1023 and i1 >= 0 and i1 <= 1023 }",
@ -17,19 +17,19 @@
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1536i0 + i1] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_A[1037i0 + i2] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_A[1536i0 + i2] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_B[i1 + 1047i2] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_B[i1 + 1536i2] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1536i0 + i1] }"
}
],
"domain" : "{ Stmt_6[i0, i1, i2] : i0 >= 0 and i0 <= 1023 and i1 >= 0 and i1 <= 1023 and i2 >= 0 and i2 <= 1023 }",

View File

@ -6,7 +6,7 @@
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_4[i0, i1] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_4[i0, i1] -> MemRef_C[1536i0 + i1] }"
}
],
"domain" : "{ Stmt_4[i0, i1] : i0 >= 0 and i0 <= 1023 and i1 >= 0 and i1 <= 1023 }",
@ -17,19 +17,19 @@
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1536i0 + i1] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_A[1037i0 + i2] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_A[1536i0 + i2] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_B[i1 + 1047i2] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_B[i1 + 1536i2] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1067i0 + i1] }"
"relation" : "{ Stmt_6[i0, i1, i2] -> MemRef_C[1536i0 + i1] }"
}
],
"domain" : "{ Stmt_6[i0, i1, i2] : i0 >= 0 and i0 <= 1023 and i1 >= 0 and i1 <= 1023 and i2 >= 0 and i2 <= 1023 }",

View File

@ -8,7 +8,7 @@ export PATH_TO_POLLY_LIB="~/polly/build/lib/"
alias opt="opt -load ${PATH_TO_POLLY_LIB}/LLVMPolly.so"
echo "--> 3. Prepare the LLVM-IR for Polly"
opt -S -mem2reg -loop-simplify -indvars matmul.s > matmul.preopt.ll
opt -S -mem2reg -loop-simplify -polly-indvars matmul.s > matmul.preopt.ll
echo "--> 4. Show the SCoPs detected by Polly"
opt -basicaa -polly-cloog -analyze -q matmul.preopt.ll