Skip to content

[MLGO] Do not include urgent LRs in max cascade calculation #120052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ bool MLEvictAdvisor::loadInterferenceFeatures(
// There is a potential that the model could be adversarial and
// continually evict live ranges over and over again, leading to a
// large amount of compile time being spent in regalloc. If we hit the
// threshold, prevent the range from being evicted.
if (IntfCascade >= MaxCascade)
// threshold, prevent the range from being evicted. We still let the
// range through if it is urgent as we are required to produce an
// eviction if the candidate is not spillable.
if (IntfCascade >= MaxCascade && !Urgent)
return false;

// Only evict older cascades or live ranges without a cascade.
Expand Down
Loading