EN FR
EN FR


Section: New Results

Splitting Polyhedra to Generate More Efficient Code

Participants : Harenome Ranaivoarivony-Razanajato, Vincent Loechner, Cédric Bastoul.

Code generation in the polyhedral model takes as input a union of Z-polyhedra and produces a code scanning all of them. Modern code generation tools are heavily relying on polyhedral operations to perform this task. However, these operations are typically provided by general-purpose polyhedral libraries that are not specifically designed to address the code generation problem. In particular, (unions of) polyhedra may be represented in various mathematically equivalent ways which may have different properties with respect to code generation. We investigated this problem and tried to find the best representation of polyhedra to generate an efficient code.

We demonstrated that this problem has been largely under-estimated, showing significant control overhead deviations when using different representations of the same polyhedra. Second, we proposed an improvement to the main algorithm of the state-of-the-art code generation tool CLooG. It generates code with less tests in the inner loops, and aims at reducing control overhead and at simplifying vectorization for the compiler, at the cost of a larger code size. It is based on a smart splitting of the union of polyhedra while recursing on the dimensions.

We implemented our algorithm in CLooG/PolyLib, and compared the performance and size of the generated code to the CLooG/isl version. Our results show that there can be important performance differences between the generated versions. In some cases, our new technique may significantly improve the quality of the generated code, but in some other cases, it may not be adequate compared to the existing solution. Finding other alternatives and chosing the best one remain open problems to be investigated in the future.