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

J4 ›› 2014, Vol. 36 ›› Issue (06): 1011-1017.

• 论文 • 上一篇    下一篇

基于数据对齐属性指导的GCC自动向量化优化

李春江,黄娟娟,徐颖,董钰山   

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

    基金项目:国家自然科学基金资助项目(61170046);国家863计划资助项目(2012AA010903)

Optimizing the auto-vectorization in GCC
based on data-alignment directives          

LI Chunjiang,HUANG Juanjuan,XU Ying,DONG Yushan   

  1. (College of Computer,National University of Defense Technology,Changsha 410073,China)
  • Received:2013-08-03 Revised:2013-11-15 Online:2014-06-25 Published:2014-06-25

摘要:

主流通用处理器都已经实现了多核并行以及处理器核内的SIMD并行。虽然GCC编译器实现了面向SIMD并行的自动向量化,但是编译器针对OpenMP并行程序的自动向量化效果仍很不理想。针对多线程并行的OpenMP程序,基于GCC的OpenMP编译实现,扩展了数据对齐属性指导语句,使编译器在自动向量化时能够进行更准确的数据对齐与否的判断,优化了GCC编译器的自动向量化。

关键词: 数据对齐属性, 编译指导, 自动向量化, GCC

Abstract:

The general purpose processors support multicore parallelism on a chip and SIMD parallelism in each core. Although GCC complier makes use of the auto-vectorization for SIMD parallelism, the effects of autovectorization for OpenMP program is far from the expectation. Based on the implementation of the OpenMP compilation in GCC, we extend complier directives with data alignment attribute directive for OpenMP program. Our work enables GCC to make a more accurate estimation  on the alignment of data access, and optimizes the auto-vectorization in GCC.

Key words: data alignment attribute;compiler directives;auto-vectorization;GCC