[PATCH] D58371: [X86] Filter out tuning feature flags and a few ISA feature flags when checking for function inline compatibility.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 18 22:40:23 PST 2019


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, andreadb, echristo.
Herald added subscribers: jdoerfert, jfb, eraman, tpr.
Herald added a project: LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D58371

Files:
  lib/Target/X86/X86TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.h
  test/Transforms/Inline/X86/inline-target-cpu-i686.ll
  test/Transforms/Inline/X86/inline-target-cpu-x86_64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58371.187308.patch
Type: text/x-patch
Size: 5164 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190219/4be29b7a/attachment.bin>


More information about the llvm-commits mailing list