Verify BB SLP scheduling to prevent SSA failures
SLP vectorization now verifies schedules, eliding unschedulable entries to prevent SSA verification failures.
This commit introduces verification for SLP (Superword Level Parallelism) node scheduling within basic blocks. It detects and rejects invalid schedules that would lead to SSA (Static Single Assignment) use-before-def errors, causing BB vectorization to fail gracefully. If an SLP graph entry cannot be scheduled, it is elided. This improvement ensures the integrity of the generated code and prevents incorrect vectorization due to scheduling issues.
In Details
This change adds a verification step to the SLP vectorizer's scheduling logic. It ensures that scheduled SLP nodes are valid with respect to SSA constraints, specifically checking for use before def issues. vect_slp_analyze_bb_1 now fails vectorization if scheduling is invalid. vect_schedule_slp_node and vect_schedule_scc are modified to return scheduling success status, and vect_schedule_slp gains the ability to elide entries that cannot be scheduled, preventing downstream SSA verification failures.
- SLP
- Superword Level Parallelism, a compiler optimization technique that finds instructions operating on scalars that can be vectorized to operate on multiple data elements simultaneously.
- SSA
- Static Single Assignment form, an intermediate representation where every variable is assigned exactly once, simplifying many compiler analyses and optimizations.
- use before def
- An error in code where a variable or value is used before it has been assigned a value, often caught by SSA verification.