计算机科学 ›› 2016, Vol. 43 ›› Issue (2): 210-215.doi: 10.11896/j.issn.1002-137X.2016.02.045

• 软件与数据库技术 • 上一篇    下一篇

面向自动向量化的结构体优化

于海宁,韩林,李鹏远   

  1. 解放军信息工程大学数学工程与先进计算国家重点实验室 郑州450001,解放军信息工程大学数学工程与先进计算国家重点实验室 郑州450001,解放军信息工程大学数学工程与先进计算国家重点实验室 郑州450001
  • 出版日期:2018-12-01 发布日期:2018-12-01
  • 基金资助:
    本文受“核高基”国家科技重大专项(2009ZX01036)资助

Structure Optimization for Automatic Vectorization

YU Hai-ning, HAN Lin and LI Peng-yuan   

  • Online:2018-12-01 Published:2018-12-01

摘要: 结构体广泛应用在科学计算等应用程序中,向量化结构体数组存在的非连续和非对齐访存会严重影响程序的向量化效果。为减少结构体数组SIMD向量化过程中的非连续和非对齐数据访问,提出了基于域访问亲和度与域数据类型相结合的结构体拆分模型,以消除域存储间的内存“间隙”;同时利用结构体数组到二维数组的地址映射方式来满足结构体数组向量化时的访存连续和对齐要求,以降低Cache的失效率,从而提升应用程序性能。在自动向量化系统SW-VEC上,选取gcc-vec、spec2000和spec2006标准测试集中部分相关的测试用例,测试结果表明:与相应的串行程序相比, 采用该方法后,测试用例程序性能加速比提高了8%以上。

关键词: 访问亲和度,结构体拆分,地址映射,SIMD向量化

Abstract: Sturcture is used more extensively to promote the performance of application program such as scientific computing.The noncontinuity and the nonalignment of its non-array memory address have a dramatic influence on the efficiency of program’s vectorization.To reduce the access to these addresses during the SIMD’s vectorization,this paper applied a structure peeling model based on the structure which combines field access affinity with type to eliminate the “clearance” of memory between field storage,and proposed an address conversion method of structure array one by one mapping to the two dimensional array to meet the request of the continuity and the alignment of its non-array memory address,further reducing the failure rate of Cache,so as to improve application performance.By using the test suites of gcc-vec,spec2000 and spec2006,the experimental results on the compiler of automatic vector show that using the me-thod,the performance of optimized programs can be improved by more than eight percent.

Key words: Access affinity,Structure peeling,Address mapping,SIMD vectorization

[1] Li Yu-xiang,Shi Hui,Chen Li.Vectorization-oriented Local Data Regrouping[J].Journal of Chinese Computer Systems,2009,30(8):1528-1534(in Chinese) 李玉祥,施慧,陈莉.面向向量化的局部数据重组[J].小型微型计算机系统,2009,30(8):1528-1534
[2] Beyls K.Software Methods to Impmve Data Locality and Cache Behavior[D].Ghent University,2004
[3] Chilimbi T M,Davidson B,Larus J R.Cache-conscious Structure Definition[C]∥Proceedings of PLDI’99.1999:13-24
[4] Hagog M,Tice C.Cache Aware Data Layout Reorganization Optimization in GCC[C]∥Proceedings of the GCC Developers’Summit.2005:69-92
[5] Zhong Y,Orlovich M,Shen X,et al.Array regrouping and structure splitting using wholeprogram reference affinity[C]∥Proceedings of PLDI’04.2004:255-266
[6] Fu Xiong,Wang Ru-chuan.Locality-based Data Reorganization Framework[J].Computer Science,2009,36(2):146-151
[7] Chilimbi T M,Davidson B,Larus J R.Cache conscious structure definition[C]∥Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implememntation.New York,USA:ACM,1999:13-24
[8] Hundt R,Mananrswamy S,Chakrabarti D R.Practical structure layout optimization and advice[C]∥Proceedings of the Fourth IEEE/ACM International Symposium on Code Generation and Optimization.Washington DC,USA:IEEE,2006:233-244
[9] Curial S,Zhao Peng,Amaral J N,et al.MPADS:Memory-pooling-assisted data splitting[C]∥Proceedings of the 7th international sysposium on Memory management.New York,USA:ACM,2008:101-110
[10] Yan Jia-nian,He Jiang-zhou,Chen Wen-guang,et al.ASLOP:A field-access affinity based structure data layout optimizer [J].Science in China Series F:Information Science,2011,54(9):1769-1783
[11] Tanaka H,Ota Y,Matsumoto N,et al.A new compilation technique for SIMD code generation across basic block boundaries[C]∥Proceedings of the 2010 Asia and South Pacific Design Automation Conference.IEEE Press,2010:101-106
[12] Zhang Yuan-yuan,Zhao Rong-cai,Han Lin.Vectorization Benefit Evaluation Method Based on Polyhedron Representation[J].Computer Engineering,2012,38(7):266-268(in Chinese) 张媛媛,赵荣彩,韩林.基于多面体表示的向量化收益评估方法[J].计算机工程,2012,38(7):266-268

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!