blob: ef9f68b4d5393958d9499c69ccb942cbf3fbdb83 [file] [log] [blame]
<!-- Material used from: HTML 4.01 specs: -->
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Polly - Load Polly into dragonegg</title>
<link type="text/css" rel="stylesheet" href="menu.css">
<link type="text/css" rel="stylesheet" href="content.css">
<div id="box">
<!--#include virtual="menu.html.incl"-->
<div id="content">
<h1>Load Polly into dragonegg and automatically run it at -O3</h1>
<p><b>Note:</b>This is a quick note on how to load Polly into
dragonegg. The choice of front-end does not affect the passes
available with Polly, only the syntax is different.
The <a href="example_load_Polly_into_clang.html">examples for use
with clang</a> can also be performed with Polly, with suitable
corrections in the syntax.
<h2>Compile dragonegg with support for LLVM plugins</h2>
The support for LLVM plugins in dragonegg is still experimental, and
hence protected by a build option. You must rebuild dragonegg with the
following options:
<pre class="code">
<h2>Load Polly into dragonegg</h2>
By loading Polly into dragonegg, the Polly options become automatically
available. You can load Polly either by adding the relevant commands to
the CPPFLAGS or by creating an alias.
<pre class="code">
$ export CPPFLAGS="-fplugin=/path/to/ -fplugin-arg-dragonegg-llvm-option=-load:${POLLY_BUILD_DIR}/lib/"
<pre class="code">
$ alias pollycc gcc -fplugin=/path/to/ -fplugin-arg-dragonegg-llvm-option=-load:${POLLY_BUILD_DIR}/lib/
<h2>Optimizing with Polly</h2>
Optimizing with Polly is as easy as adding <b>-O3 -fplugin-arg-dragonegg-llvm-option=-polly</b> to your
compiler flags (Polly is only available at -O3).
<pre class="code">pollycc -O3 -fplugin-arg-dragonegg-llvm-option=-polly file.c</pre>
<h2>Passing various options to Polly</h2>
As must be evident from the examples so far, options to LLVM and its
plugins are passed via the <b>-fplugin-arg-dragonegg-llvm-option</b>
commandline argment.
The <a href="example_load_Polly_into_clang.html">examples for use with
clang</a> can be executed with dragonegg by replacing
the <b>-mllvm</b> syntax with the dragonegg syntax.