This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by craig.topper on Feb 18 2019, 10:38 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 18 2019, 10:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2019, 10:38 PM
This revision is now accepted and ready to land.Feb 18 2019, 10:54 PM
This revision was automatically updated to reflect the committed changes.