[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)
commit236e1ce1d920204661fd73ef8960738108852647
treed92d9f7d6adb2ca38f4e29730ad7183e988c50ec
parentb4c95b338ba702f59e56ee34e41581a9e39666d0
[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

llvm-svn: 354355
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.h
llvm/test/Transforms/Inline/X86/inline-target-cpu-i686.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/X86/inline-target-cpu-x86_64.ll [new file with mode: 0644]