本文已被:浏览 1394次 下载 3576次
Received:April 28, 2021 Revised:May 21, 2021
Received:April 28, 2021 Revised:May 21, 2021
中文摘要: 为了能够生成正确、优化的机器指令代码, 需要在编译器后端代码的生成阶段, 设计和使用合适的程序栈帧布局. 由于RISC-V向量扩展架构具有可伸缩性、其向量寄存器的长度在编译时不可知, 传统的栈帧布局无法适用. 之前LLVM中针对向量扩展实现的栈帧布局虽然能够生成正确的机器指令, 但存在访存指令较多, 栈帧空间较大, 以及预留寄存器较多等问题. 我们对原有实现所存在的问题进行分析, 在此基础上提出了新的布局方式以及向量对象地址计算方式, 并通过巴塞罗那超算中心开发的测试集进行验证. 实验表明新的栈帧布局能够有效减少访存指令数和栈空间大小.
Abstract:For correct and optimized machine instructions, it is necessary to design and use a suitable program stack frame layout during the code generation stage of the compiler back-end. Due to the scalability of the RISC-V vector extension architecture and the unknown length of its vector register at compile time, the traditional stack frame layout cannot be applied. Although the previous stack frame layout implemented for vector extension in LLVM can generate correct machine instructions, it has problems such as many load/store instructions and reserved registers as well as large stack frame sizes. We analyze the problems existing in the previous implementation and propose a new layout and vector object calculation method on this basis. Then we verify it through the test set developed by the Barcelona Supercomputing Center. Experiments show that the new stack frame layout can greatly reduce the number of load/store instructions and stack space.
keywords: LLVM RISC-V vector extension stack frame layout
文章编号: 中图分类号: 文献标志码:
基金项目:中国科学院战略性先导科技专项(C类)(XDC05040200)
引用文本:
陆旭凡,胡海根,邢明杰.基于LLVM的RISC-V向量扩展栈帧布局优化.计算机系统应用,2021,30(11):27-32
LU Xu-Fan,HU Hai-Gen,XING Ming-Jie.Optimization of RISC-V Vector Extension Stack Frame Layout Based on LLVM.COMPUTER SYSTEMS APPLICATIONS,2021,30(11):27-32
陆旭凡,胡海根,邢明杰.基于LLVM的RISC-V向量扩展栈帧布局优化.计算机系统应用,2021,30(11):27-32
LU Xu-Fan,HU Hai-Gen,XING Ming-Jie.Optimization of RISC-V Vector Extension Stack Frame Layout Based on LLVM.COMPUTER SYSTEMS APPLICATIONS,2021,30(11):27-32

