LCSSA optimization for vectorization recognition rate improvement

Mengyao Chen, Yunda Chai, Jiandong Shang · Journal of Physics Conference Series · 2021

Abstract LLVM converts the loop to LCSSA during the loop transformation process. The loop of LCSSA has better locality and can facilitate other optimizations of the loop, but at this stage LLVM does not support some special LCSSA loops in the automatic vectorization process, in the case of external use of non-array and non-inductive variable instructions in the loop, automatic vectorization cannot be performed, which makes the compiler lose some optimization opportunities for automatic vectorization. In response to this problem in LLVM, this paper proposes an algorithm to reconstruct PHI nodes. By adding new basic blocks, reconstructing the value of PHI nodes to eliminate the influence of external use in the loop on automatic vectorization, so that the loop can be automatically vectorized. Improve LLVM’s automatic vectorization capabilities. Through the test on the TSVC test set, the vectorized recognition rate has increased by 23%.

Read the paper · More papers on PaperTik