OSDN Git Service

[X86] Filter out tuning feature flags and a few ISA feature flags when checking for...
authorCraig Topper <craig.topper@intel.com>
Tue, 19 Feb 2019 17:05:11 +0000 (17:05 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 19 Feb 2019 17:05:11 +0000 (17:05 +0000)
commit7300bbb81417143f104b75d2491a96e4f2437dcd
tree03af88eca8c748d739812d8a012eee71cec94799
parent379689ce0c5997a6198c0041e92b4c2720221bea
[X86] Filter out tuning feature flags and a few ISA feature flags when checking for function inline compatibility.

Tuning flags don't have any effect on the available instructions so aren't a good reason to prevent inlining.

There are also some ISA flags that don't have any intrinsics our ABI requirements that we can exclude. I've put only the most basic ones like cmpxchg16b and lahfsahf. These are interesting because they aren't present in all 64-bit CPUs, but we have codegen workarounds when they aren't present.

Loosening these checks can help with scenarios where a caller has a more specific CPU than a callee. The default tuning flags on our generic 'x86-64' CPU can currently make it inline compatible with other CPUs. I've also added an example test for 'nocona' and 'prescott' where 'nocona' is just a 64-bit capable version of 'prescott' but in 32-bit mode they should be completely compatible.

I've based the implementation here of the similar code in AMDGPU.

Differential Revision: https://reviews.llvm.org/D58371

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354355 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86TargetTransformInfo.cpp
lib/Target/X86/X86TargetTransformInfo.h
test/Transforms/Inline/X86/inline-target-cpu-i686.ll [new file with mode: 0644]
test/Transforms/Inline/X86/inline-target-cpu-x86_64.ll [new file with mode: 0644]