基于LLVM的RISC-V向量扩展栈帧布局优化
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

中国科学院战略性先导科技专项(C类)(XDC05040200)


Optimization of RISC-V Vector Extension Stack Frame Layout Based on LLVM
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 增强出版
  • |
  • 文章评论
    摘要:

    为了能够生成正确、优化的机器指令代码, 需要在编译器后端代码的生成阶段, 设计和使用合适的程序栈帧布局. 由于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.

    参考文献
    相似文献
    引证文献
引用本文

陆旭凡,胡海根,邢明杰.基于LLVM的RISC-V向量扩展栈帧布局优化.计算机系统应用,2021,30(11):27-32

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-04-28
  • 最后修改日期:2021-05-21
  • 录用日期:
  • 在线发布日期: 2021-10-22
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京海淀区中关村南四街4号 中科院软件园区 7号楼305房间,邮政编码:100190
电话:010-62661041 传真: Email:csa (a) iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号