000180458 001__ 180458
000180458 005__ 20190117220013.0
000180458 037__ $$aREP_WORK
000180458 245__ $$aOptimizing Data Structures in High-Level Programs: New Directions for Extensible Compilers based on Staging
000180458 269__ $$a2012
000180458 260__ $$c2012
000180458 300__ $$a12
000180458 336__ $$aReports
000180458 520__ $$aHigh level data structures are a cornerstone of modern programming and at the same time stand in the way of compiler optimizations. In order to reason about user or library defined data structures compilers need to be extensible. Common mechanisms to extend compilers fall into two categories. Frontend macros, staging or partial evaluation systems can be used to programmatically remove abstraction and specialize programs before they enter the compiler. Alternatively, some compilers allow extending the internal workings by adding new transformation passes at different points in the compile chain or adding new intermediate representation (IR) types. None of these mechanisms alone is sufficient to handle the challenges posed by high level data structures. This paper shows a novel way to combine them to yield benefits that are greater than the sum of the parts. Instead of using staging merely as a front end, we implement internal compiler passes using staging as well. These internal passes delegate back to program execution to construct the transformed IR. Staging is known to simplify program generation, and in the same way it can simplify program transformation. Defining a transformation as a staged IR interpreter is simpler than implementing a low-level IR to IR transformer. With custom IR nodes, many optimizations that are expressed as rewritings from IR nodes to staged program fragments can be combined into a single pass, mitigating phase ordering problems. Speculative rewriting can preserve optimistic assumptions around loops. We demonstrate several powerful program optimizations using this architecture that are particularly geared towards data structures: a novel loop fusion and deforestation algorithm, array of struct to struct of array conversion, object flattening, and code generation for heterogeneous parallel devices. We validate our approach using several non trivial case studies that exhibit good speedups in experiments.
000180458 700__ $$0243345$$g185682$$aRompf, Tiark
000180458 700__ $$aSujeeth, Arvind
000180458 700__ $$0246589$$g164625$$aAmin, Nada
000180458 700__ $$aBrown, Kevin
000180458 700__ $$0243781$$g202774$$aJovanovic, Vojin
000180458 700__ $$aLee, HyoukJoong
000180458 700__ $$g170823$$aJonnalagedda, Manohar$$0246590
000180458 700__ $$aOlukotun, Kunle
000180458 700__ $$aOdersky, Martin$$g126003$$0241835
000180458 909C0 $$xU10409$$0252187$$pLAMP
000180458 909CO $$pIC$$preport$$ooai:infoscience.tind.io:180458
000180458 917Z8 $$x185682
000180458 937__ $$aEPFL-REPORT-180458
000180458 973__ $$sPUBLISHED$$aEPFL
000180458 980__ $$aREPORT