Loop Vectorization Optimization Technique for System Calls
With the continuous advancement of modern processor architectures, SIMD (Single Instruction Multiple Data) vectorization has become one of the key techniques for improving program performance. Loop vectorization, as a core technique of SIMD optimization, can significantly enhance the execution efficiency of loop code with data parallelism. However, in practical applications, many loops contain system calls (such as printf), which often introduce side effects or uncertainties in control flow. This leads traditional compilers to adopt a conservative strategy during loop vectorization, avoiding vectorizing the entire loop. While this strategy helps prevent potential execution errors, it also leaves many loops with vectorization potential under-optimized. To address this issue, this paper proposes a loop vectorization optimization technique for loops containing system calls. By introducing directive-based guidance and appropriate handling mechanisms, the proposed method allows the compiler to identify and effectively process loops with system calls, enabling successful vectorization. Specifically, programmers can guide the compiler to selectively vectorize these loops as needed, maximizing performance improvements while ensuring program correctness. By precisely controlling which parts of the code can be vectorized and which must preserve their original execution order, this method effectively solves the problem of non-vectorizable loops with system calls, significantly improving program execution efficiency. To evaluate the effectiveness of the proposed method, we designed 24 test cases containing system calls. Experimental results show that, the highest optimization level (O3) of the compiler, the proposed method achieved an average speedup of 1.4677×. Further analysis indicates that as the ratio of computational instructions to system call instructions increases, the speedup generally rises, despite some fluctuations.
Authors
- Wenbo Liu (ORCID: https://orcid.org/0009-0005-2618-3196)
- Bo Zhao (ORCID: https://orcid.org/0000-0002-6406-3911)
- Yingying Li (ORCID: https://orcid.org/0000-0003-1905-030X)
- L. X. Liu
- Jinyang Yao (ORCID: https://orcid.org/0000-0003-1563-3882)
- Jinlong Xu (ORCID: https://orcid.org/0000-0002-6261-8186)
- Ping Zhang (ORCID: https://orcid.org/0000-0003-0060-2151)
- Chan Zhao
Publication Details
- Published
- 2025-02-21
- DOI
- https://doi.org/10.1145/3732365.3732420
- Primary Topic
- Embedded Systems Design Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00