]> gcc.gnu.org Git - gcc.git/commit
i386: Inline function with default arch/tune to caller
authorHongyu Wang <hongyu.wang@intel.com>
Fri, 30 Jun 2023 01:44:56 +0000 (09:44 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Thu, 6 Jul 2023 06:41:22 +0000 (14:41 +0800)
commite24b8256fe37df6ad39e2634c66ade70ca7c4e83
tree73a338662f6adf611e715a121c2459eccdc7e0d8
parent0d40aeb9b85db87e4a502a530db5b89027d1a3b6
i386: Inline function with default arch/tune to caller

For function with different target attributes, current logic rejects to
inline the callee when any arch or tune is mismatched. Relax the
condition to allow callee with default arch/tune to be inlined.

gcc/ChangeLog:

* config/i386/i386.cc (ix86_can_inline_p): If callee has
default arch=x86-64 and tune=generic, do not block the
inlining to its caller. Also allow callee with different
arch= to be inlined if it has always_inline attribute and
it's ISA is subset of caller's.

gcc/testsuite/ChangeLog:

* gcc.target/i386/inline_attr_arch.c: New test.
* gcc.target/i386/inline_target_clones.c: Ditto.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.target/i386/inline_attr_arch.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/inline_target_clones.c [new file with mode: 0644]
This page took 0.068728 seconds and 5 git commands to generate.