Avoid setting ls_type when unused
The compiler now avoids setting `ls_type` unnecessarily in vectorization, improving efficiency.
This commit optimizes vectorization by avoiding setting the ls_type on loads/stores when the type isn’t actually used. The change modifies get_load_store_type in tree-vect-stmts.cc to only set ls_type when vect_use_grouped_gather succeeds.
In Details
In tree-vect-stmts.cc, the get_load_store_type function now passes a temporary variable to vect_use_grouped_gather and only sets ls_type if vectorization with grouped gathers succeeds. This prevents unnecessary setting of ls_type when it's not used.
For Context
Vectorization is a compiler optimization that allows multiple data elements to be processed simultaneously using single instructions. This commit improves the efficiency of GCC's vectorization process by avoiding unnecessary operations when determining the data type of loads and stores. By only setting the type when it's actually needed, the compiler can reduce overhead and potentially improve performance.