https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121762
Bug ID: 121762
Summary: pass_fold_builtins and pass_optimize_widening_mul and
pass_gimple_isel should be merged or moved other
places
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: internal-improvement
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: pinskia at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
https://gcc.gnu.org/pipermail/gcc-patches/2025-September/694091.html
>From pass_fold_builtins:
So these remove the builtins (either folding them to a GIMPLE_NOP, a variable
or a constant) or removing the branch to them. So they can improve the quality
of late passes.
ASSUME removing -> forwprop with late set
BUILT_IN_UNREACHABLE -> forwprop with late set
BUILT_IN_CONSTANT_P -> forwprop with late set (zero)
BUILT_IN_ASSUME_ALIGNED -> forwprop with late set (first argument)
BUILT_IN_STACK_RESTORE -> forwprop with late set (removes call)
BUILT_IN_VA* -> forwprop with stdarg prop set or late set
va_start(&ap,0) -> ap = next_arg (0)
va_end (&ap) -> Remove
va_copy(&a,b) -> `a = b`
BUILT_IN_MEMCMP -> pass_gimple_isel
BUILT_IN_{SYNC,ATOMIC}* -> pass_gimple_isel
>From pass_optimize_widening_mul:
match_single_bit_test (popcount) -> pass_gimple_isel
convert_mult_to_widen -> pass_gimple_isel
Rename pass_optimize_widening_mul .
The rest of pass_optimize_widening_mul most likely should be moved to fowrprop
with late Prop set .