About Polly

Polly is a high-level loop and data-locality optimizer and optimization infrastructure for LLVM. It uses an abstract mathematical representation based on integer polyhedra to analyze and optimize the memory access pattern of a program. We currently perform classical loop transformations, especially tiling and loop fusion to improve data-locality. Polly can also exploit OpenMP level parallelism, expose SIMDization opportunities. Work has also be done in the area of automatic GPU code generation.

For many users, however, it's not the existing optimizations in Polly that are of most interest, but the new analyses and optimizations enabled by the Polly infrastructure. At polyhedral.info you can get an idea of what has already been done and what is possible in the context of polyhedral compilation.




A source checkout that contains Polly now provides Polly functionality by default in clang/opt/bugpoint without the need to load an additional module.


AST Generation Paper published in TOPLAS

The July issue of TOPLAS contains a 50 page discussion of the AST generation techniques used in Polly. This discussion gives not only an in-depth description of how we (re)generate an imperative AST from our polyhedral based mathematical program description, but also gives interesting insights about:
  • Schedule trees: A tree-based mathematical program description that enables us to perform loop transformations on an abstract level, while issues like the generation of the correct loop structure and loop bounds will be taken care of by our AST generator.
  • Polyhedral unrolling: We discuss techniques that allow the unrolling of non-trivial loops in the context of parameteric loop bounds, complex tile shapes and conditionally executed statements. Such unrolling support enables the generation of predicated code e.g. in the context of GPGPU computing.
  • Isolation for full/partial tile separation: We discuss native support for handling full/partial tile separation and -- in general -- native support for isolation of boundary cases to enable smooth code generation for core computations.
  • AST generation with modulo constraints: We discuss how modulo mappings are lowered to efficient C/LLVM code.
  • User-defined constraint sets for run-time checks We discuss how arbitrary sets of constraints can be used to automatically create run-time checks that ensure a set of constrainst actually hold. This feature is very useful to verify at run-time various assumptions that have been taken program optimization.
Polyhedral AST generation is more than scanning polyhedra
Tobias Grosser, Sven Verdoolaege, Albert Cohen
ACM Transations on Programming Languages and Systems (TOPLAS), 37(4), July 2015


Polly allows now non-affine subregions

Data-dependent or floating point conditionals inside a SCoP can now be overapproximated in order to increase the applicability on general purpose code.


Polly drops the support of ScopLib and the external optimizer PoCC

The support for ScopLib as an exchange format has been removed as recent versions of clan, candl and pluto all support the OpenScop exchange format. The support of the external optmizer PoCC has been dropped in favor of the isl optimizer (default) and the still available pluto support.


Polly can be built without GPL licensed software

After Sebastian Pop's and David Peixotto's (both Qualcomm) recent commit to isl, isl's latest development version can be built with imath instead of GMP. With both CLooG and gmp having become optional, the last obilgatory dependency to GPL licensed software has been removed. Now Polly only depends on isl (and the included imath), which are both MIT licensed.


Polly Phone Call - 23April

We had a polly phone call about delinearizing array accesses (II)Meeting notes are available online.

Polly Phone Call - 17th April

We had a polly phone call about delinearizing array accesses Meeting notes are available online.

Polly Phone Call - 10th April

We had a polly phone call. Meeting notes are available online.

Polly Phone Call - 4th April

We had a polly phone call. Meeting notes are available online.


Static link Polly into tools

Polly can now be configured with 'cmake -D LINK_POLLY_INTO_TOOLS:Bool=ON' to be statically linked in the tools (opt, bugpoint, and clang.) This makes it easier to use polly without having to load a shared library, and it also reduces the complexity of compiling Polly on Windows.


Polly presentation at FOSDEM 2014

Polly was presented at the FOSDEM LLVM developer's meeting.

New LLVM test-suite buildbots

The set of Polly buildbots has been extended. We now have 16 new blades that track correctness and performance when compiling the LLVM test-suite. For now five of them are used to provide fine granularity reports (almost per-commit) for 'clang -O3' (no polly). We also have six machines that track different configurations of polly.


islplot released

islplot is a library that generates illustrations of integer sets and maps. It relies on isl to model the integer sets and uses the islpy Python bindings to access them. Plotting is performed with matplotlib. The following Examples show its use.


Loop optimization BoF at upcoming LLVM conference

At the upcoming LLVM conference there will be a loop optimization BoF discussing Polly and other high level loop optimizers.


Automatic code coverage and static analysis tests

Sylvestre Ledru set up automatic tests for code coverage and static analysis which run at least once a day and which include results for Polly.

Move to CLooG 0.18.1 and isl 0.12.1

With the move to an isl 0.12 version Polly can be compiled without the need to link directly to GMP (if isl is used for code generation). Currently isl is still internally using GMP, but private patches exist to also remove this dependency. Without the use of GMP, a GPL free version of Polly is possible.


New publication in the PPL Journal

We published a journal version of the Polly paper named Polly - Performing polyhedral optimizations on a low-level intermediate representation in the Parallel Processing Letters 2012.


Experimental support for the new isl code generator

The code generator can be parameterized on a fine-grained level. It gives direct control for example over unrolling, the amount of control overhead and the code size. It can also be used to create loops to handle border conditions or to perform full-partial tile separation.
We also relicensed isl under the MIT license. This means, with the exception of GMP (LGPL), there is no other (L)GPL licensed software used in Polly. The use of GMP is limited to a well defined interface. Replacing it with a BSD licensed replacement is a tractable engineering project we would be very interested in. For more information about isl see the isl manual.


Polly can now be directly linked to the Pluto optimizer. We were already able to perform Pluto-like optimizations with Polly, as a similar algorithm was added to isl half a year ago. However, being able to directly compare with the original implementation will not only bring in competition in the optimizer field. It will also allow new experiments with a cutting edge research tool.
This support was on of the outcomes of the 1-day Polly workshop and the following week of joint work at IISC Bangalore and in cooperation with AMD India.


Polly is an official LLVM project, reachable at http://polly.llvm.org


Improved support for the isl scheduling optimizer

Polly can now automatically optimize all polybench 2.0 kernels without the help of an external optimizer. The compile time is reasonable and we can show notable speedups for various kernels.



Talk at the LLVM Developer Meeting 2011

New SCEV parser
(Allows parameters in array subscript and max/signextend)


Polly can use the isl schedule optimizer
(The optimizer is similar to the one in Pluto, but it is part of isl)


Use Polly as clang plugin


Polly builder as part of the LLVM Buildbots


Tobias is founded for three years by a Google Europe Fellowship in Efficient Computing.


Tobias' diploma thesis and Raghesh's master thesis. See our list of publications.


Polly moves to the LLVM infrastructure (svn, bugtracker)


Presentation at CGO/IMPACT

Polly can compile polybench 2.0 with vectorization and OpenMP code generation


pollycc - a script to automatically compile with polyhedral optimizations


Basic OpenMP support, Alias analysis integration, Pluto/POCC support



Basic vectorization support


Talk at the LLVM Developer Meeting


Dependency analysis

Finished Phase 1 - Get something working

Support scalar dependences and sequential SCoPs


RegionInfo pass committed to LLVM

llvm-test suite compiles


Code generation works for normal SCoPs.


The CLooG AST can be parsed.


SCoPs can automatically be detected.


The RegionInfo framework is almost completed.


Translate a simple loop to Polly-IR and regenerate a loop structure with CLooG works.

ISL and CLooG are integrated.


The RegionInfo pass is finished.


End of the year

Work on the infrastructure started.