Computer Engineering and Applications ›› 2016, Vol. 52 ›› Issue (6): 19-25.

Previous Articles     Next Articles

Implementation and effects of loop-array-prefetching optimization in GCC

DONG Yushan, LI Chunjiang, XU Ying   

  1. Institute of Computer, School of Computer Science, National University of Defense Technology, Changsha 410073, China
  • Online:2016-03-15 Published:2016-03-17

GCC编译器中循环数组预取优化的实现及效果

董钰山,李春江,徐  颖   

  1. 国防科学技术大学 计算机学院 计算机研究所,长沙 410073

Abstract: Data prefetching is an approach to reducing cache miss latencies, which can appropriately fill the speed gap between the microprocessor and DRAM. As the widely used open source compiler collection, GCC achieves prefetching arrays used in loops on the tree-ssa. After analyzing the implementation and effects of the loop-array-prefetching in GCC4.9, and dissecting three heuristics of a cost model, which determine whether or not prefetching is profitable for a given loop based on the profitability and analysis time, after testing some benchmarks with GCC, this paper concludes several factors affecting the effect of loop-arrays-prefetching. These works provide a valuable contribution for the research and development of the loop-array-prefetching optimization in GCC.

null

Key words: GNU Compiler Collection(GCC), data prefetching, loop, cost model

摘要: 数据预取技术是为缓解微处理器与DRAM之间速度差异而出现的隐藏访存延迟的方法。GCC作为广泛使用的开源编译器,在tree-ssa上对循环级数组实现了预取优化。在深入分析GCC4.9循环级数组预取的基本实现机制,以及剖析基于预取收益和分析时间的三种不予预取的代价模型的基础上,得出影响循环数组预取效果的几个因素,并针对典型测试用例测试了GCC编译器循环数组预取的效果。此项工作对于改进和提高GCC现有循环级数组的预取优化有指导意义。

关键词: GNU编译器集合(GCC), 数组预取, 循环, 代价模型