Our current loop unroller is very simple and possibly broken. In particular it doesn't use loop information present in annotated LST nodes. We should look to implement a better loop unroller. Some related papers are:
Optimized Unrolling of Nested Loops. Vivek Sarkar. ACM International Conference on Supercomputing (ICS), May, 2000.
Optimized Unrolling of Nested Loops. Vivek Sarkar. International Journal on Parallel Programming 29(5), pps. 545-581, October 2001.