Handle uniform arguments in OMP SIMD vectorization.
Fixes an ICE in OMP SIMD vectorization when uniform arguments cannot be vectorized.
This commit addresses an internal compiler error (ICE) that occurred during OMP SIMD vectorization when a uniform argument within a SIMD function could not be assigned a suitable vector type. The compiler now gracefully handles such cases by giving up on vectorizing these specific uniform arguments, preventing the crash and improving robustness for SIMD-aware parallel code.
In Details
When vectorizing OMP SIMD functions, uniform arguments that cannot be represented by a vector type can cause an ICE, particularly when assigned to an SLP node. This patch modifies vectorizable_simd_clone_call to detect when a vector type for a uniform argument cannot be computed and to fail this specific argument's vectorization rather than crashing. This involves refactoring to handle 'scalar lanes' within SIMD constructs.
- tree-optimization
- A phase in the GCC compiler where the intermediate representation (GIMPLE's 'tree' format) is analyzed and transformed to improve code efficiency.
- OMP SIMD
- OpenMP directives that allow loops to be vectorized, enabling SIMD (Single Instruction, Multiple Data) instructions for parallel execution on multiple data elements simultaneously.
- vectorization
- The process of transforming scalar operations into operations that can be performed on multiple data elements in parallel using SIMD instructions.
- ICE
- Internal Compiler Error, indicating a bug within the compiler itself.
- uniform argument
- In the context of SIMD or OpenMP, an argument whose value is the same for all lanes or threads executing the parallel construct.
- SLP node
- Short for Simd-Lowering Pass node. A data structure used in GCC's vectorization framework to group and transform sequences of identical scalar operations into vector operations.