Skip to main content

Color Flipping

  • Conference paper
  • First Online:
Book cover Programming Languages (SBLP 2015)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9325))

Included in the following conference series:

Abstract

Spill code minimization is an important problem in register allocation because it affects the quality of the code produced by the compiler and program performance. This work presents a new technique to reduce spill code, called color flipping. Differently of other techniques, color flipping prevents all load/store instructions insertion when avoiding spill. Nevertheless, color flipping can be used in combination with other spill minimization techniques to achieve an overall better result. To evaluate the impact of using color flipping, experiments with a set of interference graphs and with the benchmark SPEC CPU2006, showed over 12 % of spill reduction.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Appel, A.W.: Standard ml of New Jersey (1996). http://www.smlnj.org/. Accessed 18 Nov 2014

  2. Appel, A.W., George, L.: Sample graph coloring problems (1996). https://www.cs.princeton.edu/appel/graphdata/. Accessed 18 Nov 2014

  3. Barany, G., Krall, A.: Optimal and heuristic global code motion for minimal spilling. In: Jhala, R., De Bosschere, K. (eds.) Compiler Construction. LNCS, vol. 7791, pp. 21–40. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  4. Bergner, P., Dahl, P., Engebretsen, D., O’Keefe, M.: Spill code minimization via interference region spilling. In: Proceedings of the ACM SIGPLAN 1997 Conference on Programming Language Design and Implementation, PLDI 1997, pp. 287–295. ACM, New York (1997). http://doi.acm.org/10.1145/258915.258941

  5. Bernstein, D., Golumbic, M., Mansour, Y., Pinter, R., Goldin, D., Krawczyk, H., Nahshon, I.: Spill code minimization techniques for optimizing compliers. In: Proceedings of the ACM SIGPLAN 1989 Conference on Programming Language Design and Implementation. PLDI 1989, pp. 258–263. ACM, New York (1989). http://doi.acm.org/10.1145/73141.74841

  6. Briggs, P., Cooper, K.D., Kennedy, K., Torczon, L.: Coloring heuristics for register allocation. In: Proceedings of the ACM SIGPLAN 1989 Conference on Programming language design and implementation. PLDI 1989, pp. 275–284. ACM, New York (1989). http://doi.acm.org/10.1145/73141.74843

  7. Briggs, P.: Register allocation via graph coloring. Ph.D. thesis, Rice University (1992)

    Google Scholar 

  8. Briggs, P., Cooper, K.D., Torczon, L.: Rematerialization. In: Feldman, S.I., Wexelblat, R.L. (eds.) PLDI, pp. 311–321. ACM (1992)

    Google Scholar 

  9. Chaitin, G.J.: Register allocation & spilling via graph coloring. In: Proceedings of the 1982 SIGPLAN Symposium on Compiler Construction, SIGPLAN 1982, pp. 98–105. ACM, New York (1982). http://doi.acm.org/10.1145/800230.806984

  10. Chaitin, G.J., Auslander, M.A., Chandra, A.K., Cocke, J., Hopkins, M.E., Markstein, P.W.: Register allocation via coloring. Comput. Lang. 6(1), 47–57 (1981)

    Article  Google Scholar 

  11. Chow, F.C., Hennessy, J.L.: The priority-based coloring approach to register allocation. ACM Trans. Program. Lang. Syst. 12(4), 501–536 (1990). http://doi.acm.org/10.1145/88616.88621

    Article  Google Scholar 

  12. Chow, F., Hennessy, J.: Register allocation by priority-based coloring. In: Proceedings of the 1984 SIGPLAN Symposium on Compiler Construction, SIGPLAN 1984, pp. 222–232. ACM, New York (1984). http://doi.acm.org/10.1145/502874.502896

  13. Cooper, K.D., Simpson, L.T.: Live range splitting in a graph coloring register allocator. In: Koskimies, K. (ed.) CC 1998. LNCS, vol. 1383, pp. 174–187. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  14. Gao, L., Shi, C.: An improved approach of register allocation via graph coloring. In: Proceedings of the SPIE, vol. 5683, no. 5, pp. 113–123, May 2005

    Google Scholar 

  15. George, L., Appel, A.W.: Iterated register coalescing. ACM Trans. Program. Lang. Syst. 18(3), 300–324 (1996). http://doi.acm.org/10.1145/229542.229546

    Article  Google Scholar 

  16. Goodwin, D.W., Wilken, K.D.: Optimal and near-optimal global register allocations using 0–1 integer programming. Softw. Pract. Exper. 26(8), 929–965 (1996)

    Article  Google Scholar 

  17. Govindarajan, R., Yang, H., Amaral, J.N., Zhang, C., Gao, G.R.: Minimum register instruction sequencing to reduce register spills in out-of-order issue superscalar architectures. IEEE Trans. Comput. 52(1), 4–20 (2003). http://dx.doi.org/10.1109/TC.2003.1159750

    Article  Google Scholar 

  18. Hames, L., Scholz, B.: Nearly optimal register allocation with PBQP. In: Lightfoot, D.E., Ren, X.-M. (eds.) JMLC 2006. LNCS, vol. 4228, pp. 346–361. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  19. Kempe, A.B.: On the geographical problem of the four colours. Am. J. Math. 2(3), 193–200 (1879)

    Article  MathSciNet  Google Scholar 

  20. Koseki, A., Komatsu, H., Nakatani, T.: Spill code minimization by spill code motion. In: Proceedings of the 22nd International Conference on Parallel Architectures and Compilation Techniques 0, p. 125 (2003)

    Google Scholar 

  21. Lattner, C., Adve, V.: Llvm: A compilation framework for lifelong program analysis & transformation. In: Proceedings of the International Symposium on Code Generation and Optimization: Feedback-directed and Runtime Optimization, CGO 2004, p. 75. IEEE Computer Society, Washington (2004). http://dl.acm.org/citation.cfm?id=977395.977673

  22. Olesen, J.S.: Greedy register allocation in llvm 3.0 (2011). http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-September/043511.html. Accessed 25 Aug 2014

  23. Poletto, M., Sarkar, V.: Linear scan register allocation. ACM Trans. Program. Lang. Syst. 21(5), 895–913 (1999). http://doi.acm.org/10.1145/330249.330250

    Article  Google Scholar 

  24. Sarkar, V., Barik, R.: Extended linear scan: an alternate foundation for global register allocation. In: Adsul, B., Odersky, M. (eds.) CC 2007. LNCS, vol. 4420, pp. 141–155. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  25. Smith, M.D., Ramsey, N., Holloway, G.: A generalized algorithm for graph-coloring register allocation. In: Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation, PLDI 2004, pp. 277–288. ACM, New York (2004). http://doi.acm.org/10.1145/996841.996875

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Felipe L. Silva .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Silva, F.L., Luna, M.F., Attrot, W. (2015). Color Flipping. In: Pardo, A., Swierstra, S. (eds) Programming Languages. SBLP 2015. Lecture Notes in Computer Science(), vol 9325. Springer, Cham. https://doi.org/10.1007/978-3-319-24012-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-24012-1_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-24011-4

  • Online ISBN: 978-3-319-24012-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics