-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate LLVM at llvm/llvm-project@5e53a8dadb00
Updates LLVM usage to match [5e53a8dadb00](llvm/llvm-project@5e53a8dadb00) PiperOrigin-RevId: 705873858
- Loading branch information
1 parent
a43ab80
commit 1f2dd7f
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
Auto generated patch. Do not edit or delete it, even if empty. | ||
diff -ruN --strip-trailing-cr a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp | ||
--- a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp | ||
+++ b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp | ||
@@ -63,6 +63,12 @@ | ||
"outgoing name should be " | ||
"<regalloc-evict-interactive-channel-base>.out")); | ||
|
||
+static cl::opt<unsigned> | ||
+ MaxCascade("mlregalloc-max-cascade", cl::Hidden, | ||
+ cl::desc("The maximum number of times a live range can be " | ||
+ "evicted before preventing it from being evicted"), | ||
+ cl::init(20)); | ||
+ | ||
// Options that only make sense in development mode | ||
#ifdef LLVM_HAVE_TFLITE | ||
#include "RegAllocScore.h" | ||
@@ -643,8 +649,16 @@ | ||
RegClassInfo.getNumAllocatableRegs(MRI->getRegClass(VirtReg.reg())) < | ||
RegClassInfo.getNumAllocatableRegs( | ||
MRI->getRegClass(Intf->reg()))); | ||
- // Only evict older cascades or live ranges without a cascade. | ||
+ | ||
unsigned IntfCascade = RA.getExtraInfo().getCascade(Intf->reg()); | ||
+ // 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) | ||
+ return false; | ||
+ | ||
+ // Only evict older cascades or live ranges without a cascade. | ||
if (Cascade <= IntfCascade) { | ||
if (!Urgent) | ||
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters