This Loop Quasi-Invariant Chunk Motion pass use the "pyCParser" to modify C programs' AST and produce an optimized one semantically equivalent.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Loop Quasi-Invariant Chunk Motion

This is a pass which computes the invariance degree of each statement in loops and inner loops in a way to peel them.

With a relation composition, it is able to hoist an entire invariant or quasi-invariant inner loop.


This uses the pycparser.


Install pycparser.

Run on examples:

$ python yourfile.c


$ python c_files/example2.c


The .c file given needs to contain only functions (no includes or other macros etc…)