A superblock unroller creates a superblock in a first instruction stream,
and unrolls the superblock using different methods depending on the
suitability of the superblock to different types of unrolling. The
superblock unroller uses complete unrolling if a number of iterations of
the superblock is sufficiently small and if the number of iterations is
known at compile-time. The superblock unroller uses static unrolling if
the number of iterations of the superblock is too large for complete
unrolling and if the number of iterations is known at compile-time. The
superblock unroller uses dynamic unrolling if the number of iterations of
the superblock is unknown at compile-time. Each of these unrolling
methods may include the insertion of count rectification code into the
first instruction stream to account for execution that exits the
superblock. Code performance may be improved by providing the
sophisticated unrolling of superblocks disclosed herein.