节点文献

面向SIMD的编译指导与条件分支的编译优化技术

Compilation Optimization on Compiler Directive and Conditional Branch for SIMD

【作者】 朱嘉风

【导师】 赵荣彩;

【作者基本信息】 解放军信息工程大学 , 计算机软件与理论, 2011, 硕士

【摘要】 随着SIMD扩展技术的不断发展,几乎所有的主流处理器厂商都为自己的微处理器提供SIMD扩展部件与相关SIMD指令集。然而应用程序一般很难直接适用于SIMD扩展,需要对其进行必要的向量化处理。本文针对SIMD编译优化技术研究的一些常见难题而提出了两种SIMD编译优化技术:条件分支语句的SIMD编译优化技术和基于编译指导的SIMD编译优化技术。在条件分支语句的SIMD编译优化技术方面,根据SIMD扩展和条件分支语句的特征,提出了一种在一个向量因子内的条件分支语句变换方法,能够有效地将条件分支语句所引发的控制依赖转换为数据依赖,避免控制依赖对编译器优化分析的影响;在得到向量化循环之后,通过条件分支重建恢复循环的控制流语义,最终达到在保证控制流语义正确的前提下,充分发掘循环数据流中的并行性的目的。在基于编译指导的SIMD编译优化技术方面,借鉴并行化编译研究中比较流行的并行编程语言思想,根据程序员对应用程序的了解,利用编译指导设定编译器的状态或者引导编译器完成一些特定的动作,以满足生成所需代码的需求,有效解决编译器因程序分析能力不足而无法自动实现循环向量化或者盲目自动向量化的问题。本文所述的两种SIMD编译优化技术已在项目研发的SW-VEC向量化编译系统上得到实现。测试结果表明,这两种SIMD编译优化技术能够有效提高SW-VEC向量化编译系统的向量化识别和生成向量化目标代码的能力,实现应用程序在SIMD扩展上加速运行的目的。

【Abstract】 With the development of SIMD Extension, most of microprocessor manufacturers have provided SIMD Extension and related SIMD Instruction Set for their own microprocessors. However, applications can be hardly adapt to SIMD Extension, vectorizing them before running is essential. This thesis introduces two kinds of SIMD Compilation Optimization Technology for the problem in the research on SIMD Compilation Optimization Technology. The first one is SIMD Compilation Optimization Technology of Conditional Branch Statement, and the second one is SIMD Compilation Optimization Technology based on Compiler Directive.For Conditional Branch Statement in SIMD Compiler Optimization, the thesis proposes a method to transform Conditional Branch Statement within a Vector Length, according to the characteristics of SIMD Extension and Conditional Branch Statement. Control dependence triggered by Conditional Branch Statement can be effectively transformed into data dependence, and the control dependence?s impact of compiler?s optimization analysis can be avoided. With the transformed vector loop, the control flow?s semantics of the original loop will be rebuilt by rebuilding conditional branch. Finally, under the precondition of the correctness of control flow semantics, the parallelism of the data flow can be fully exploited.On the other hand, the idea of popular parallel programming language in parallel compilation is used for reference by SIMD Compilation Optimization Technology based on Compiler Directive. According to the programmer?s understanding of the application, Compiler Directive is used to set the state of the compiler or guide the compiler to perform some special actions in order to generate the required code. Thus, the problems that compiler can not perform auto-vectorization or does blind auto-vectorization because of the low capability of code analysis can be effectively solved.The SIMD Compilation Optimization Technologies in this thesis have been achieved in SW-VEC vectorization compiler. Test result shows that the performance of SW-VEC vectorization compiler to identify the statements which can be vectorized and generate the vectorization code can be effectively improved, and application can run faster in SIMD Extension.

节点文献中: