Combinatorial spill code optimization and ultimate coalescing

Roberto Castañeda Lozano, Mats Carlsson, Gabriel Hjort Blindell, Christian Schulte
2014 Proceedings of the 2014 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems - LCTES '14  
This paper presents a novel combinatorial model that integrates global register allocation based on ultimate coalescing, spill code optimization, register packing, and multiple register banks with instruction scheduling (including VLIW). The model exploits alternative temporaries that hold the same value as a new concept for ultimate coalescing and spill code optimization. The paper presents Unison as a code generator based on the model and advanced solving techniques using constraint
more » ... g. Thorough experiments using MediaBench and a processor (Hexagon) that are typical for embedded systems demonstrate that Unison: is robust and scalable; generates faster code than LLVM (up to 41% with a mean improvement of 7%); possibly generates optimal code (for 29% of the experiments); effortlessly supports different optimization criteria (code size on par with LLVM). Unison is significant as it addresses the same aspects as traditional code generation algorithms, yet is based on a simple integrated model and robustly can generate optimal code. jump ifn t 4 , b 3 ← p 3 ∶t 1 , p 4 ∶{t 2 , t 5 }, p 5 ∶{t 3 , t 6 } p 6 ∶t 7 , p 7 ∶t 8 , p 8 ∶t 9 ← { , t 10 } ← { , tfr, ldw} { , t 8 } { , t 11 } ← { , tfr, ldw} { , t 9 } t 12 ← mul {t 9 , t 11 }, {t 8 , t 10 , t 13 } { , t 13 } ← { , tfr, ldw} { , t 8 } t 14 ← sub {t 8 , t 10 , t 13 }, 1 t 15 ← cmp.gt t 14 , 0 { , t 16 } ← { , tfr, stw} { , t 12 } { , t 17 } ← { , tfr, stw} { , t 14 } jump if t 15 , b 2 ← p 9 ∶t 7 , p 10 ∶{t 12 , t 16 }, p 11 ∶{t 14 , t 17 }
doi:10.1145/2597809.2597815 dblp:conf/lctrts/LozanoCBS14 fatcat:fkcll7muwnew3cwrrqmv6qhgai