AArch64: Add POLY_INT_CST bounds for SVE optimizations
Enables SVE constant folding by defining bounds for vector length computations.
This patch introduces bounds for POLY_INT indeterminate constants on AArch64, specifically for Scalable Vector Extension (SVE) operations. This allows GCC to recognize that certain vector length calculations, like svcntb() and svcntw(), always produce results within known ranges. Consequently, comparisons involving these values can be folded away, simplifying code and improving optimization.
In Details
This commit implements the TARGET_POLY_INT_INDETERMINATE_BOUND hook for AArch64 SVE. It allows the ranger pass to determine that svcntb() and svcntw() return values within defined bounds (e.g., vl < 257 and svcntw() <= 64 are always true). This enables constant folding of expressions involving these SVE vector length queries, which was previously missed due to the indeterminate nature of POLY_INT_CST.
- POLY_INT_CST
- A GCC internal representation for an integer constant that may vary, often used in symbolic computations or with variable vector lengths.
- SVE
- Scalable Vector Extension, an ARM architecture feature that allows vector length to be determined at runtime, offering flexibility and performance scaling.
- AArch64
- The 64-bit execution state of the ARMv8-A architecture and later.
- svcntb()
- An SVE intrinsic function that returns the number of bytes per vector register.
- svcntw()
- An SVE intrinsic function that returns the number of words (32-bit elements) per vector register.