Avoid live code-generation for stmts kept as scalars
GCC now avoids unnecessary live code generation for scalar statements used in SLP graph leafs, simplifying the vectorization process.
This commit optimizes the SLP (Superword Level Parallelism) vectorization pass in GCC by avoiding live code generation for scalar definitions that are kept in scalar form because they are used as external inputs in SLP graph leafs. This change resolves specific cases where workarounds were needed during live code generation, streamlining the vectorization process and potentially improving performance.
In Details
This patch modifies tree-vect-slp.cc to prevent live code generation for scalar defs that are kept due to their use in SLP graph leafs as extern inputs. The change affects vect_bb_slp_mark_live_stmts and resolves known cases requiring workarounds in live code generation, simplifying the process.
For Context
Vectorization is a compiler optimization technique that converts scalar operations (operating on single values) into vector operations (operating on multiple values simultaneously). SLP (Superword Level Parallelism) is a form of vectorization that identifies independent scalar operations and combines them into vector operations. This change optimizes the vectorization process by avoiding unnecessary code generation for scalar statements, which can improve the efficiency of the compiled code.