summaryrefslogtreecommitdiff
path: root/test-chill/test-cases/examples/chill/unroll.script
diff options
context:
space:
mode:
Diffstat (limited to 'test-chill/test-cases/examples/chill/unroll.script')
-rw-r--r--test-chill/test-cases/examples/chill/unroll.script35
1 files changed, 35 insertions, 0 deletions
diff --git a/test-chill/test-cases/examples/chill/unroll.script b/test-chill/test-cases/examples/chill/unroll.script
new file mode 100644
index 0000000..e64acb6
--- /dev/null
+++ b/test-chill/test-cases/examples/chill/unroll.script
@@ -0,0 +1,35 @@
+#
+# Test unroll-and-jam. The last loop adapted from the simple
+# convolution example from p463 of "Optimizing Compilers for
+# Modern Architectures", by Randy Allen and Ken Kennedy.
+#
+
+source: unroll.c
+procedure: foo
+format: rose
+# fully unroll a loop with known iteration count
+loop: 0
+original()
+unroll(0,1,3)
+print
+print space
+
+
+# a strided loop
+loop: 1
+original()
+unroll(0,1,2)
+print
+print space
+
+# lower and upper bounds are not constant
+loop: 2
+original()
+unroll(0,1,20)
+print
+
+# parallelogram iteration space
+loop: 3
+original()
+unroll(0,1,2)
+print