GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc

Match.pd single_use tracks statement-level usage for vector permutations.

GIMPLE match.pd single_use now tracks if all uses are within a single statement, fixing vector permutation handling.

This change modifies the single_use tracking in match.pd to monitor if all uses of an expression occur within a single statement, rather than just a single actual use. This correction is necessary for correctly handling complex vector permutation expressions where a subexpression might be used multiple times within the same statement, ensuring that optimizations like VEC_PERM_EXPR are applied as expected.

In Details

The gimple-match-head.cc file's single_use predicate is adjusted. Previously, it tracked a single instance of an expression's use. Now, it tracks whether all uses fall within a single statement. This change addresses a limitation where expressions with multiple uses within the same statement were not correctly identified as 'single-use', impacting pattern matching for VEC_PERM_EXPR on vector types.

Filed Under: gccoptimizationvector instructions