引用本文:马春燕,吕炳旭,叶许姣,张雨.基于LLVM Pass的复杂嵌套循环自动并行化框架.软件学报,2023,34(7):3022-3042
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 2267次   下载 5308 本文二维码信息
码上扫一扫!
分享到: 微信 更多
基于LLVM Pass的复杂嵌套循环自动并行化框架
马春燕1, 吕炳旭1, 叶许姣1, 张雨2
1.西北工业大学 软件学院, 陕西 西安 710129;2.海南大学 计算机科学与技术学院, 海南 海口 570228
摘要:
随着多核处理器的普及应用,针对嵌入式遗留系统中串行代码的自动并行化方法是研究热点.其中,针对具有非完美嵌套结构、非仿射依赖关系特征的复杂嵌套循环的自动并行化方法存在技术挑战.提出了一种基于LLVM Pass的复杂嵌套循环的自动并行化框架(CNLPF).首先,提出了一种复杂嵌套循环的表示模型,即循环结构树,并将嵌套循环的正则区域自动转换为循环结构树表示;然后,对循环结构树进行数据依赖分析,构建循环内和循环间的依赖关系;最后,基于OpenMP共享内存的编程模型生成并行的循环程序.针对SPEC2006数据集中包含近500个复杂嵌套循环的6个程序案例,分别对其进行复杂嵌套循环占比统计和并行性能加速测试.结果表明,提出的自动并行化框架可以处理LLVMPolly无法优化的复杂嵌套循环,增强了LLVM的并行编译优化能力,且该方法结合Polly的组合优化,比单独采用Polly优化的加速效果提升了9%-43%.
关键词:  复杂嵌套循环  自动并行化  LLVM Pass  依赖分析
DOI:10.13328/j.cnki.jos.006858
分类号:
基金项目:国家自然科学基金(62192733,62062030);航空基金(20185853038,201907053004)
Automatic Parallelization Framework for Complex Nested Loops Based on LLVM Pass
MA Chun-Yan1, LÜ Bing-Xu1, YE Xu-Jiao1, ZHANG Yu2
1.School of Software, Northwestern Polytechnical University, Xi'an 710129, China;2.School of Computer Science and Technology, Hainan University, Haikou 570228, China
Abstract:
With the popularization of multi-core processors, automatic parallelization of serial codes in embedded legacy systems is a research hotspot, while there are technical challenges in the automatic parallelization method for complex nested loops with imperfect nested structure and non-affine dependency characteristics. This study proposes an automatic parallelization framework (CNLPF) for complex nested loops based on LLVM Pass. Firstly, a representation model of complex nested loops, namely loop structure tree, is proposed, and the regular region of nested loops is automatically converted into a loop structure tree representation. Then, the data dependency analysis is carried out on the loop structure tree to construct intra-loop and inter-loop dependency relationship. Finally, the parallel loop program is generated based on the OpenMP shared memory programming model. For the 6 program cases in the SPEC2006 data set containing nearly 500 complex nested loops, the statistics of the proportion of complex nested loops and the parallel performance acceleration test were carried out respectively. The results show that the automatic parallelization framework proposed in this study can deal with complex nested loops that cannot be optimized by LLVM Polly, which enhances the parallel compilation and optimization capabilities of LLVM, and the method combined with Polly optimization improves the acceleration effect of Polly optimization alone by 9%-43%.
Key words:  complex nested loop  automatic parallelization  LLVM Pass  dependency analysis

引用本文:
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览次   下载  
分享到: 微信 更多
摘要:
关键词:  
DOI:
分类号:
基金项目:
Abstract:
Key words: