
Some standard intra-procedural optimizations. Useful to clean up code after certain
transformations. This transformation is experimental. mergeLocals is particularly
useful after inlining, as it reduces the number of local variables in the combined function.
This can be helpful for subsequent transformations (like virtualization).
The loopUnroll optimization replicates each loop body a number of
times, set by --OptimizeLoopUnrollCount. It works on for,
while and do-while loops, and preserves the
program's behavior for any number of iterations, including loops that use
break and continue. For example, to unroll the loops in
function f three times:
tigress --Environment=x86_64:Linux:Gcc:11 \
--Transform=Optimize \
--Functions=f \
--OptimizeKinds=loopUnroll \
--OptimizeLoopUnrollCount=3 \
program.c --out=result.c
| Option | Arguments | Description |
|---|---|---|
| --Transform | Optimize | Some standard intra-procedural optimizations. Useful to clean up code after certain transformations. |
| --OptimizeKinds | constProp, copyProp, mergeLocals, deadCodeElim, gotos, loopUnroll | List of optimizing transformations to apply Default=NONE.
|
| --OptimizeDumpInterferenceGraph | For, mergeLocals, write the interference graph to a *.neato file. It can be visualized using neato -Tpdf foo-interferenceGraph.neato > foo.pdf. Default=False. | |
| --OptimizeShortMergedNames | For, mergeLocals, generate short names for merged local variables, instead of the default var1_var2_.... Default=False. | |
| --OptimizeLoopUnrollCount | For loopUnroll, the number of copies of each loop body to emit per loop iteration (the unroll factor). A value of 1 leaves loops unchanged. Default=2. |