Re: [PATCH] i386: Relax inline requirement for functions with different target attrs

2023-06-28 Thread Uros Bizjak via Gcc-patches
On Wed, Jun 28, 2023 at 10:20 AM Hongyu Wang wrote: > > > If the user specified a different arch for callee than the caller, > > then the compiler will switch on different ISAs (-march is just a > > shortcut for different ISA packs), and the programmer is aware that > > inlining isn't intended her

Re: [PATCH] i386: Relax inline requirement for functions with different target attrs

2023-06-28 Thread Hongyu Wang via Gcc-patches
> If the user specified a different arch for callee than the caller, > then the compiler will switch on different ISAs (-march is just a > shortcut for different ISA packs), and the programmer is aware that > inlining isn't intended here (we have -mtune, which is not as strong > as -march, but even

Re: [PATCH] i386: Relax inline requirement for functions with different target attrs

2023-06-27 Thread Uros Bizjak via Gcc-patches
On Wed, Jun 28, 2023 at 3:56 AM Hongyu Wang wrote: > > > I don't think this is desirable. If we inline something with different > > ISAs, we get some strange mix of ISAs when the function is inlined. > > OTOH - we already inline with mismatched tune flags if the function is > > marked with always_

Re: [PATCH] i386: Relax inline requirement for functions with different target attrs

2023-06-27 Thread Hongyu Wang via Gcc-patches
> I don't think this is desirable. If we inline something with different > ISAs, we get some strange mix of ISAs when the function is inlined. > OTOH - we already inline with mismatched tune flags if the function is > marked with always_inline. Previously ix86_can_inline_p has if (((caller_opts->

Re: [PATCH] i386: Relax inline requirement for functions with different target attrs

2023-06-27 Thread Uros Bizjak via Gcc-patches
On Mon, Jun 26, 2023 at 4:36 AM Hongyu Wang wrote: > > Hi, > > For function with different target attributes, current logic rejects to > inline the callee when any arch or tune is mismatched. Relax the > condition to honor just prefer_vecotr_width_type and other flags that > may cause safety issue