MONDAY, SEPTEMBER 14, 2026
tree-optimization
Fix vector PAREN_EXPR code generation for assignments.
Correctly generates code for parenthesized expressions in vector assignments, fixing a bug in vectorization.
This commit fixes a bug where parenthesized expressions (PAREN_EXPR) were incorrectly dropped during vector code generation. This led to bogus code when vectorizing assignments. The fix ensures that PAREN_EXPRs are properly handled, improving the accuracy of vectorization.
In Details
The vectorizer in GCC incorrectly ignored PAREN_EXPR nodes in vectorizable assignments. This commit modifies vectorizable_assignment in tree-vect-stmts.cc to properly generate code for these expressions, ensuring that parenthesized subexpressions are not lost during the vectorization pass.
For Context
- PAREN_EXPR
- An intermediate representation (IR) node in GCC that represents a parenthesized expression in the source code. It signifies grouping but doesn't change the expression's evaluation order on its own.
- Vectorization
- An optimization technique that transforms a scalar loop into a vector loop, performing the same operation on multiple data elements simultaneously using SIMD (Single Instruction, Multiple Data) instructions. This can significantly improve performance.