tlooto

Fast and flexible instruction selection with constraints

Patrick Thier

2018.2.24Proceedings of the 27th International Conference on Compiler Construction

Paper details

Journal
Proceedings of the 27th International Conference on Compiler Construction
Published
2018.2.24
Citations
2
References
25
Fields
Computer Science

tlooto Summary

This paper introduces constraints that say whether a tree-grammar rule is applicable or not, and integrates constraints in an instruction selector that matches DAGs with tree rules, resulting in faster instruction selection than with pure instruction-selection-time dynamic programming.

Abstract

Tree-parsing instruction selection as used in, e.g., lcc, uses dynamic costs to gain flexibility and handle situations (such as read-modify-write instructions) that do not fit into the basic tree-parsing model. The disadvantage of dynamic costs is that we can no longer turn the tree grammar into a tree automaton (as is done by burg) for fast instruction selection for JIT compilers. In this paper we introduce constraints that say whether a tree-grammar rule is applicable or not. While theoretically less powerful than dynamic costs, constraints cover the practical uses of dynamic costs; more importantly, they allow turning the tree grammar with constraints into a tree automaton (with instruction-selection-time checks), resulting in faster instruction selection than with pure instruction-selection-time dynamic programming. We integrate constraints in an instruction selector that matches DAGs with tree rules. We evaluate this concept in lcc and the CACAO JavaVM JIT compiler, and see instruction selector speedups by a factor 1.33--1.89.

Citation format

THIER, Patrick. Fast and flexible instruction selection with constraints. Proceedings of the 27th International Conference on Compiler Construction, 2018: 93–103.