Directive-based automatic function-level vectorization for simplified SIMD exploitation
摘要
The integration of Single Instruction, Multiple Data (SIMD) extensions has become crucial for enhancing computational performance. While loop-level and superword-level vectorization techniques have matured, function-level vectorization remains challenging. Existing OpenMP declare simd mechanisms require repetitive annotations at both function declarations and call sites–particularly cumbersome across separate compilation units–thus limiting their practical applicability. This paper presents Automatic Function-level Vectorization (AFV), a directive-based framework designed to simplify function-level vectorization within OpenMP. We propose managing function vectorization directives at the loop level rather than the function level, thereby extending the OpenMP API with AFV directives. Additionally, we introduce an optimization framework at the intermediate representation stage that automatically inserts vectorization directives into called functions, generating vectorized versions and enhancing loop vectorization that includes function calls. Importantly, this approach remains effective for function calls across compilation units. Experimental evaluation using benchmarks from Intel’s SPMD Program Compiler and SIMD libraries validates the framework’s superiority across four dimensions: in terms of performance, AFV achieves 1.65