On Mon, May 18, 2026 at 2:54 PM H.J. Lu <[email protected]> wrote:
>
> On Mon, May 18, 2026 at 2:11 PM Richard Biener
> <[email protected]> wrote:
> >
> > On Mon, May 18, 2026 at 8:08 AM H.J. Lu <[email protected]> wrote:
> > >
> > > On Mon, May 18, 2026 at 1:56 PM Richard Biener
> > > <[email protected]> wrote:
> > > >
> > > > On Mon, May 18, 2026 at 4:25 AM Liu, Hongtao <[email protected]> 
> > > > wrote:
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: H.J. Lu <[email protected]>
> > > > > > Sent: Monday, May 18, 2026 5:52 AM
> > > > > > To: GCC Patches <[email protected]>; Uros Bizjak
> > > > > > <[email protected]>; Liu, Hongtao <[email protected]>
> > > > > > Subject: [PATCH] x86: Don't inline memmove for -Os
> > > > > >
> > > > > > OK for master and backport to GCC 16?
> > > > > Ok.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > --
> > > > > > H.J.
> > > > > > ---
> > > > > > Update ix86_expand_movmem to return false if 
> > > > > > optimize_function_for_size_p
> > > > > > returns true to avoid inlining memmove for -Os.
> > > >
> > > > I think you should use optimize_insn_for_size_p instead.
> > >
> > > Do you have a testcase to show that it makes a difference?
> >
> > It will make a difference with PGO, cold code should be optimized for size.
> > Another testcase would be -O2 with a path ending in abort(), so prediction
> > makes it cold.
> >
>
> Here is the patch.  OK for master and backport to GCC 16?
Ok, optimize_insn_for_size_p () should be better.
>
> Thanks.
>
> --
> H.J.
> ---
> Replace optimize_function_for_size_p with optimize_insn_for_size_p in
> ix86_expand_movmem to avoid inlining cold memmove call.
>
> gcc/
>
> PR target/125355
> * config/i386/i386-expand.cc (ix86_expand_movmem): Replace
> optimize_function_for_size_p with optimize_insn_for_size_p.
>
> gcc/testsuite/
>
> PR target/125355
> * gcc.target/i386/pr125355-2.c: New test.



-- 
BR,
Hongtao

Reply via email to