This is an archive of the discontinued LLVM Phabricator instance.

[nfc][regalloc] Make the max inference cutoff configurable
ClosedPublic

Authored by mtrofin on Feb 1 2022, 8:27 AM.

Details

Summary

Added a flag to make configurable the number of interferences after
which we 'bail out' and treat a set of intervals as un-evictable. Also
using it on the ML side, as it turns out to be a good control for
compile-time.

With this configurable, we can do a bit of trial and error and see if
bumping it has any effect on heuristic/policy quality.

Diff Detail

Event Timeline

mtrofin created this revision.Feb 1 2022, 8:27 AM
mtrofin requested review of this revision.Feb 1 2022, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2022, 8:27 AM
yundiqian accepted this revision.Feb 1 2022, 10:44 AM
This revision is now accepted and ready to land.Feb 1 2022, 10:44 AM
This revision was landed with ongoing or failed builds.Feb 2 2022, 7:30 AM
This revision was automatically updated to reflect the committed changes.
mstorsjo added inline comments.
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
63

This broke compilation for me:

../lib/CodeGen/MLRegallocEvictAdvisor.cpp: In member function ‘bool {anonymous}::MLEvictAdvisor::loadInterferenceFeatures(llvm::LiveInterval&, llvm::MCRegister, bool, const SmallVirtRegSet&, {anonymous}::FeaturesListNormalizer&, size_t) const’:
../lib/CodeGen/MLRegallocEvictAdvisor.cpp:549:50: error: ‘EvictInterferenceCutoff’ was not declared in this scope
  549 |     const auto &IFIntervals = Q.interferingVRegs(EvictInterferenceCutof );
      |                                                  ^~~~~~~~~~~~~~~~~~~~~~
../lib/CodeGen/MLRegallocEvictAdvisor.cpp: At global scope:

I guess that's because EvictInterferenceCutoff is declared within an ifdef that isn't taken in my build configuration.