使用xDSL的助手式编译
Sidekick compilation with xDSL
AI总结:
本文提出助手式编译器框架概念,通过文本交换格式和声明式抽象实现多框架互操作,并以xDSL为例展示其在教学、DSL编译和重写系统原型开发中简化从原型到生产过渡的作用。
摘要:
传统上,编译器研究人员要么在现有的生产级编译器中进行实验,要么开发自己的原型编译器;这两种选择都存在权衡。一方面,在生产级编译器中进行原型开发可能很繁琐,因为这些编译器通常以牺牲软件简洁性和开发速度为代价来优化程序编译速度。另一方面,从原型编译器过渡到生产环境需要大量的工程工作。为了弥合这一差距,我们引入了助手式编译器框架(sidekick compiler frameworks)的概念,这种方法利用文本交换格式和抽象的声明式描述,使多个框架能够相互互操作。每个这样的编译器框架都针对特定用例进行了专门化,例如性能优化或原型开发。抽象在设计上跨框架共享,从而简化了从原型开发到生产环境的过渡。我们用xDSL来演示这一想法,xDSL是一个专注于原型开发和教学的MLIR助手。xDSL通过共享的文本IR以及通过IR定义语言(IR Definition Language)交换IR的方式与MLIR互操作。我们通过三个用例展示了xDSL如何影响其开发,从而评估助手式编译器框架的益处:教学、DSL编译和重写系统原型开发。我们还研究了xDSL所提供的权衡,并演示了如何使用IRDL方言简化框架之间的过渡。通过助手式编译,我们设想了一个未来:工程师通过选择为他们的即时需求而构建的框架来最小化开发成本,随后以最小的开销过渡到生产环境。
英文摘要:
Traditionally, compiler researchers either conduct experiments within an existing production compiler or develop their own prototype compiler; both options come with trade-offs. On one hand, prototyping in a production compiler can be cumbersome, as they are often optimized for program compilation speed at the expense of software simplicity and development speed. On the other hand, the transition from a prototype compiler to production requires significant engineering work. To bridge this gap, we introduce the concept of sidekick compiler frameworks, an approach that uses multiple frameworks that interoperate with each other by leveraging textual interchange formats and declarative descriptions of abstractions. Each such compiler framework is specialized for specific use cases, such as performance or prototyping. Abstractions are by design shared across frameworks, simplifying the transition from prototyping to production. We demonstrate this idea with xDSL, a sidekick for MLIR focused on prototyping and teaching. xDSL interoperates with MLIR through a shared textual IR and the exchange of IRs through an IR Definition Language. The benefits of sidekick compiler frameworks are evaluated by showing on three use cases how xDSL impacts their development: teaching, DSL compilation, and rewrite system prototyping. We also investigate the trade-offs that xDSL offers, and demonstrate how we simplify the transition between frameworks using the IRDL dialect. With sidekick compilation, we envision a future in which engineers minimize the cost of development by choosing a framework built for their immediate needs, and later transitioning to production with minimal overhead.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。