• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2012, Vol. 34 ›› Issue (7): 71-77.

• 论文 • 上一篇    下一篇

一种面向自动向量化和数据置换操作的中间表示

陈向, 沈立   

  1. (国防科学技术大学计算机学院,湖南 长沙 410073)
  • 收稿日期:2010-06-17 修回日期:2010-11-10 出版日期:2012-07-25 发布日期:2012-07-25
  • 基金资助:

    国家973计划资助项目(2007CB310901);国家自然科学基金资助项目(60803041)

An Automatic Vectorization and Data Permutation Oriented Intermediate Representation

CHEN Xiang,SHEN Li   

  1. (School of Computer Science,National University of Defense Technology,Changsha 410073,China)
  • Received:2010-06-17 Revised:2010-11-10 Online:2012-07-25 Published:2012-07-25

摘要:

在现有的SIMD程序设计中,编译器或程序员都需要借助置换指令对参与运算的向量操作数进行重新组织,才能符合SIMD指令的要求。这些置换指令带来了较大的性能损失。本文提出了一种新的中间表示,它能够完整地记录标量和向量操作数的存储地址信息,使得置换指令的产生尽可能地推后,减少了冗余置换指令的产生。利用这种中间表示实现了一种数据置换操作的优化算法,它能够有效地减少置换指令带来的性能损失。面向一组典型的多媒体程序进行测试的结果表明,本文提出的方法可以平均获得7%的性能加速。

关键词: 中间表示, SIMD, 数据置换

Abstract:

Compilers or programmers have to use a permutation instruction to reorganize the element of vectors to get the correct operands for the SIMD instructions in the design of a SIMD program recently. But these redundant permutation instructions result in performance loss. This paper proposes a new intermediate representation, which contains enough address messages for the operands of scalar and vector. It makes the generation of data permutations be postponed and the redundant permutation instruction be reduced. We utilize this new intermediate representation to implement an optimization algorithm on data permutation, which can effectively reduce the performance loss from permutation instruction. The test result to a group of typical multimedia program shows that the algorithm can achieve 7% performance acceleration on average.

Key words: intermediate representation;SIMD;data permutation