计算机与现代化

• 软件工程 • 上一篇    下一篇

基于全局数据重组的循环倾斜优化

  

  1. (1.南方电网科学研究院有限责任公司,广东 广州 510080;
    2.电力行业信息安全等级保护测评中心第五实验室,广东 广州 510080;
    3.数学工程与先进计算国家重点实验室,河南 郑州 450002)
  • 收稿日期:2016-10-01 出版日期:2017-06-23 发布日期:2017-06-23
  • 作者简介:陈华军(1980-),男,湖北黄冈人,南方电网科学研究院有限责任公司、电力行业信息安全等级保护测评中心第五实验室高级工程师,硕士,研究方向:电力系统信息通信与信息安全; 王琦(1992-),男,数学工程与先进计算国家重点实验室硕士研究生,研究方向:先进编译,高性能计算; 洪超(1987-),男,助理研究员,硕士,研究方向:计算机网络,信息安全; 方萌(1989-),男,助理研究员,硕士,研究方向:大数据,云计算,云安全。

Loop Skewing Optimization on Global Data Regrouping

  1. (1. China South Power Grid International Co., Ltd., Guangzhou 510080, China;
    2. 5th Lab, Electric Power Information Security Classified Protection Test and Evaluation Center, Guangzhou 510080, China;
    3. State Key Laboratory of Mathematical Engineering and Advanced Computing, Zhengzhou 450002, China)
  • Received:2016-10-01 Online:2017-06-23 Published:2017-06-23

摘要: 循环倾斜是程序优化中一种循环变换的手段,它改变空间迭代形式,将循环存在的跨迭代的并行用传统的并行标识出来,使得循环可以并行执行。但是循环倾斜后,并行执行的数据在内存中是离散的,而且每次迭代执行的次数是不一致的。为了更有效地利用SIMD,本文提出一种基于全局数据重组的循环倾斜优化方法。首先分析循环倾斜优化,针对数据离散的问题实现全局数据重组,改善数据局部性,循环易于向量化操作;针对迭代执行次数不一致问题,实现非满载向量操作,使尾循环得以向量执行。最后选择wavefront程序进行测试,优化后,程序计算可以获得平均10.73倍的加速效果。

关键词: 单指令多数据流, 循环倾斜, 数据重组, 非满载向量化

Abstract: Loop skewing is a method of loop transformation in program optimization. It changes the form of iteration space and marks the across iterations in loops with the traditional parallel. The loop can be calculated in parallel. But after loop skewing, data which is programed in parallel is discrete. Times of every iteration execution are different. To make full use of SIMD extension, this paper presents loop skewing optimization on global data regrouping. We analyze loop skewing optimization and regroup the data in array for the problem of discrete data. This part improves the data locality and it is simple to do the vector operation. Then we realize the non-full vector operation for the problem of different iteration times. This part makes the tail loop can be executed in vectorization. At last, we choose the wavefront program for testing. After optimization, the program execution speed can be increased by 10.73 times in average.

Key words: SIMD, loop skew, data regroup, non-full vector operation

中图分类号: