Swing Modulo scheduling (SMS) is a software pipelining[2] implementation which exploits inter-iteration ILP. It produces a new loop kernel in which instructions from different iterations of the loop are scheduled in parallel. It is implemented in GCC[3] since version 4.0 and can be triggered by using -fmodulo-sched and -fmodulo-sched-allow-regmoves flags.

Using SMS in GCC

SMS is triggered by the following set of flags:

-O3 -fmodulo-sched-allow-regmoves -fmodulo-sched -funsafe-loop-optimizations -fdump-rtl-sms -fira-algorithm=priority

Information regarding which loop was SMSed can be tracked in the dump file by setting -fdump-rtl-sms, i.e:

"SMS succeeded 28 4 (with ii, sc)"

Testing SMS

patch_mainline_sms_7.txt patch includes the set of patches which should go on top of mainline version. It includes the following patches:

Richard Sandiford's patches:


* [0/4] Make SMS schedule register moves

[1/4] SMS: remove register undo list

[2/4] SMS: Use ids to represent ps_insns

[3/4] SMS: Record moves in the partial schedule

[4/4] Make SMS schedule register moves

* Support instructions with REG_INC_NOTE


[1] J. Llosa, A. Gonzalez, E. Ayguade, and M. Valero. Swing modulo scheduling: A lifetime sensitive approach. In Proceedings of the 1996 Conference on Parallel Architectures and Compilation Techniques (PACT ’96), pages 80–87, Boston, Massachusetts, USA, October 1996.

[2] M. Lam. Software pipelining: An effective scheduling technique for VLIW machines, Proceedings of the ACM SIGPLAN 1988 conference on Programming Language Design and Implementation.

[3] M. Hagog and A. Zaks. Swing modulo scheduling for GCC. In Proceedings of the GCC Developer Summit 2004, pages 55–64, June 2004. 17

WorkingGroups/ToolChain/UsingSMS (last modified 2011-09-08 16:22:08)