...
首页> 外文期刊>Electronic Notes in Theoretical Computer Science >Treegraph-based Instruction Scheduling for Stack-based Virtual Machines
【24h】

Treegraph-based Instruction Scheduling for Stack-based Virtual Machines

机译:基于堆栈的虚拟机的基于树图的指令调度

获取原文
           

摘要

Given the growing interest in the JVM and Microsoft?s CLI as programming language implementation targets, code generation techniques for efficient stack-code are required. Compiler infrastructures such as LLVM are attractive for their highly optimizing middleend. However, LLVM?s intermediate representation is register-based, and an LLVM code generator for a stack-based virtual machine needs to bridge the fundamental differences of the register and stack-based computation models.In this paper we investigate how the semantics of a register-based IR can be mapped to stack-code. We introduce a novel program representation called treegraphs. Treegraph nodes encapsulate computations that can be represented by DFS trees. Treegraph edges manifest computations with multiple uses, which is inherently incompatible with the consuming semantics of stack-based operators. Instead of saving a multiply-used value in a temporary, our method keeps all values on the stack, which avoids costly store and load instructions. Code-generation then reduces to scheduling of treegraph nodes in the most cost-effective way.We implemented a treegraph-based instruction scheduler for the LLVM compiler infrastructure. We provide experimental results from our implementation of an LLVM backend for TinyVM, which is an embedded systems virtual machine for C.
机译:鉴于人们对JVM和Microsoft CLI作为编程语言实现目标的兴趣日益浓厚,因此需要用于有效堆栈代码的代码生成技术。 LLVM等编译器基础结构因其高度优化的中间端而吸引人。但是,LLVM的中间表示是基于寄存器的,并且用于基于堆栈的虚拟机的LLVM代码生成器需要弥合寄存器和基于堆栈的计算模型的基本差异。基于寄存器的IR可以映射到堆栈代码。我们介绍了一种新颖的程序表示形式,称为树图。 Treegraph节点封装了可以由DFS树表示的计算。树形图边缘体现了多种用途的计算,这与基于堆栈的运算符的使用语义固有地不兼容。我们的方法不是将乘用的值临时保存,而是将所有值保留在堆栈中,从而避免了昂贵的存储和加载指令。然后,代码生成以最经济的方式减少到树形图节点的调度。我们为LLVM编译器基础架构实现了基于树形图的指令调度器。我们从TinyVM的LLVM后端实现中提供实验结果,TinyVM是C的嵌入式系统虚拟机。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号