aarch64: Move vector operation handling to gimple_folder::fold
Vector operation handling on AArch64 is unified into `gimple_folder::fold` for improved robustness.
On AArch64, handling of vector operations (vops), particularly those involving floating-point exceptions, has been moved to the main gimple_folder::fold routine. This change aims to simplify the logic and improve robustness by ensuring vops are correctly managed whether folding occurs before or during SSA form, and by properly handling cases where vops might be forgotten or lead to ICEs (Internal Compiler Errors), especially with -ftrapping-math.
In Details
The gimple_folder::fold_to_stmt_vops helper function is being deprecated in favor of integrating its logic directly into gimple_folder::fold. This addresses issues where vdefs associated with builtins (like vadd_f32) were not correctly propagated or removed when folding occurred in SSA form, particularly with -ftrapping-math. The change also refactors how extra statements are added, using a sequence instead of an iterator to better support gsi_replace_with_seq_vops.
- AArch64
- The 64-bit ARM architecture. GCC has a specific backend for this architecture.
- vops
- Vector operations. Operations performed on multiple data elements simultaneously using vector registers and instructions.
- gimple_folder::fold
- A function within GCC's GIMPLE (Generic Intermediate Representation) processing that attempts to simplify or combine expressions and statements.
- SSA
- Static Single Assignment form. An intermediate representation in compilers where every variable is assigned exactly once, simplifying many analyses and optimizations.
- vdef
- A representation of a definition of a vector variable in GCC's intermediate representation. Correctly handling vdefs is crucial for SSA-based optimizations.
- ICE
- Internal Compiler Error. An unrecoverable error within the compiler itself, often indicating a bug in the compiler's logic.
- FP exceptions
- Floating-point exceptions. Errors or exceptional conditions that can occur during floating-point arithmetic operations, such as division by zero or overflow.