next up previous contents index
Next: 8.1.6 Algebraic Simplifications Up: 8.1 Optimizations Previous: 8.1.4 Loop Optimizations   Contents   Index


8.1.5 Loop Reversing

This optimization is done to reduce the overhead of checking loop boundaries for every iteration. Some simple loops can be reversed and implemented using a ``decrement and jump if not zero'' instruction. SDCC checks for the following criterion to determine if a loop is reversible (note: more sophisticated compilers use data-dependency analysis to make this determination, SDCC uses a more simple minded analysis).



2008-12-05