arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.06127cs.LOcs.AR
收藏

为指令选择高效综合最低代价重写规则

Efficiently Synthesizing Lowest Cost Rewrite Rules for Instruction Selection

Ross Daly, Caleb Donovick, Caleb Terrill, Jackson Melchert, Priyanka Raina, Clark Barrett, Pat Hanrahan

AI总结:

针对指令选择重写规则综合现有方法受限单指令ISA且效率低的问题,提出两种优化SMT综合算法,分别生成唯一规则和最低代价规则,在多ISA上实现最高768倍、4004倍的速度提升。

摘要:

将程序编译到指令集架构(ISA)需要一组重写规则,将由编译器指令组成的模式映射到由ISA指令组成的模式。我们通过构建SMT查询来综合这类规则,其解代表两个功能等价的程序,这两个程序可被解释为一条指令选择重写规则。现有工作仅限于单指令ISA模式,而我们的方案没有这一限制。此外,我们通过开发两种优化算法解决了现有工作的低效问题。第一种算法通过避免综合重复规则和复合规则,仅生成唯一规则;第二种算法通过避免综合更高代价的规则,仅生成最低代价规则。我们在多种ISA上评估了算法。若不使用我们的优化,绝大多数综合得到的重写规则要么是重复的、复合的,要么代价更高。我们的优化使两种算法的综合速度分别提升了最高768倍和4004倍。

英文摘要:

Compiling programs to an instruction set architecture (ISA) requires a set of rewrite rules that map patterns consisting of compiler instructions to patterns consisting of ISA instructions. We synthesize such rules by constructing SMT queries, whose solutions represent two functionally equivalent programs. These two programs are interpreted as an instruction selection rewrite rule. Existing work is limited to single-instruction ISA patterns, whereas our solution does not have that restriction. Furthermore, we address inefficiencies of existing work by developing two optimized algorithms. The first only generates unique rules by preventing synthesis of duplicate and composite rules. The second only generates lowest-cost rules by preventing synthesis of higher-cost rules. We evaluate our algorithms on multiple ISAs. Without our optimizations, the vast majority of synthesized rewrite rules are either duplicates, composites, or higher cost. Our optimizations result in synthesis speed-ups of up to 768x and 4004x for the two algorithms.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑