> -----Original Message-----
> From: Uros Bizjak <ubiz...@gmail.com>
> Sent: Wednesday, June 25, 2025 12:53 AM
> To: gcc-patches@gcc.gnu.org
> Cc: Cui, Lili <lili....@intel.com>
> Subject: [committed] i386: Convert LEA stack adjust insn to SUB when
> FLAGS_REG is dead
> 
> ADD/SUB is faster than LEA for most processors. Also, there are several
> peephole2 patterns available that convert prologue esp subtractions to pushes
> (at the end of i386.md). These process only patterns with flags reg clobber, 
> so
> they are ineffective with clobber-less stack ptr adjustments, introduced by 
> r16-
> 1551
> ("x86: Enable separate shrink wrapping").
> 
> Introduce a peephole2 pattern that adds a clobber to a clobber-less stack ptr
> adjustments when FLAGS_REG is dead.
> 
> gcc/ChangeLog:
> 
>     * config/i386/i386.md
>     (@pro_epilogue_adjust_stack_add_nocc<mode>): Add type attribute.
>     (pro_epilogue_adjust_stack_add_nocc peephole2 pattern):
>     Convert pro_epilogue_adjust_stack_add_nocc variant to
>     pro_epilogue_adjust_stack_add when FLAGS_REG is dead.
> 
> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
> 

Great, thanks!

Lili.

> Uros.

Reply via email to