# Loop Quasi-Invariant Chunk Motion by peeling with statement composition

**Authors:** Jean-Yves Moyen (Department of Computer Science University of, Copenhagen (DIKU)), Thomas Rubiano (Universit\'e Paris 13 - LIPN), Thomas, Seiller (Department of Computer Science University of Copenhagen (DIKU))

arXiv: 1704.05589 · 2017-04-20

## TL;DR

This paper introduces a novel dependency analysis technique using statement composition to identify quasi-invariants in loops, enabling more effective loop peeling and potential complexity reduction in compiler optimizations.

## Contribution

It proposes a new ICC-inspired analysis for composed statements called Chunks, allowing detection of quasi-invariants and loop optimization opportunities in compilers.

## Key findings

- Implemented a proof of concept on a toy C parser analyzing ASTs.
- Developed a prototype analysis pass on LLVM.
- Theoretical framework for dependency analysis with statement composition.

## Abstract

Several techniques for analysis and transformations are used in compilers. Among them, the peeling of loops for hoisting quasi-invariants can be used to optimize generated code, or simply ease developers' lives. In this paper, we introduce a new concept of dependency analysis borrowed from the field of Implicit Computational Complexity (ICC), allowing to work with composed statements called Chunks to detect more quasi-invariants. Based on an optimization idea given on a WHILE language, we provide a transformation method - reusing ICC concepts and techniques - to compilers. This new analysis computes an invariance degree for each statement or chunks of statements by building a new kind of dependency graph, finds the maximum or worst dependency graph for loops, and recognizes if an entire block is Quasi-Invariant or not. This block could be an inner loop, and in that case the computational complexity of the overall program can be decreased. We already implemented a proof of concept on a toy C parser 1 analysing and transforming the AST representation. In this paper, we introduce the theory around this concept and present a prototype analysis pass implemented on LLVM. In a very near future, we will implement the corresponding transformation and provide benchmarks comparisons.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1704.05589/full.md

## Figures

20 figures with captions in the complete paper: https://tomesphere.com/paper/1704.05589/full.md

## References

14 references — full list in the complete paper: https://tomesphere.com/paper/1704.05589/full.md

---
Source: https://tomesphere.com/paper/1704.05589