This is an archive of the discontinued LLVM Phabricator instance.

[X86] Split off x86-64-v* tuning flags
ClosedPublic

Authored by RKSimon on Feb 26 2023, 11:49 AM.

Details

Summary

Noticed when reviewing D143786, we are currently inheriting the x86-64-v* tuning flags from specific CPUs when really we need these to be a mixture of common traits and tuning to avoid specific severe regressions (e.g. popcnt false dependencies).

Diff Detail

Event Timeline

RKSimon created this revision.Feb 26 2023, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2023, 11:49 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon requested review of this revision.Feb 26 2023, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2023, 11:49 AM
goldstein.w.n added inline comments.Feb 26 2023, 12:09 PM
llvm/lib/Target/X86/X86.td
766

I think this is safe to remove by v4.

776

I thought this was fixed by skylake?

RKSimon added inline comments.Feb 26 2023, 1:49 PM
llvm/lib/Target/X86/X86.td
776

https://github.com/llvm/llvm-project/issues/33216 suggests its still a problem on Skylake/CannonLake as well.

goldstein.w.n added inline comments.Feb 26 2023, 2:59 PM
llvm/lib/Target/X86/X86.td
776

https://stackoverflow.com/questions/25078285/replacing-a-32-bit-loop-counter-with-64-bit-introduces-crazy-performance-deviati

says fixed by cannonlake so should be good to drop by v4 (definitely fixed by ICL).

It looks like we can tweak the tuning flags further once we've split them from the SNB/HSW/SKX variants - I'd like to commit this as an initial NFC patch and then make adjustments (drop TuningSlow3OpsLEA / TuningPOPCNTFalseDeps from X86-64-v4) as follow up reviewed patches once we have better test coverage.

This revision is now accepted and ready to land.Feb 27 2023, 9:41 AM
This revision was landed with ongoing or failed builds.Feb 27 2023, 1:49 PM
This revision was automatically updated to reflect the committed changes.
Matt added a subscriber: Matt.Feb 27 2023, 6:41 PM