The invention discloses a duplicating propagation optimization method oriented to a vectorized predicate execution
instruction sequence, and belongs to the field of compilation optimization. Aiming at the problems that an existing
copying propagation method is difficult to adapt to
strong coupling characteristics of vector variables and predicate registers, identification of
copying instructions with predicate domains is insufficient, and cross-basic-block analysis is not adaptive to predicate control flows, the instructions are divided according to whether the predicate domains are contained or not, and only non-predicate instructions are optimized; constructing a
control flow graph with predicates and a vector variable-register mapping and DU / UD chain; identifying a local and global
rewriting relationship by combining predicate field
verification; and a safety propagation rule is designed by adapting to hardware characteristics, and full-process automatic optimization is realized. According to the method, redundant memory access and register operation are reduced, code execution efficiency is improved, manual optimization dependence is reduced, the method is adaptive to architectures based on
reduced instruction set computing (RISC), single instruction multiple data (
SIMD), VLIW and the like, and the method is particularly suitable for high-
performance computing and other scenes based on the RISC principle.