Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: src/IceTargetLowering.cpp

Issue 1395693005: Subzero: Implement "second-chance bin-packing" for register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 9a8a02ab9ed504efbe3652ca78ae16d2bcfaf6ba..3a960cdad30835410dbc0598d42a3088846218ef 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -267,9 +267,15 @@ void TargetLowering::regAlloc(RegAllocKind Kind) {
RegInclude |= RegSet_CalleeSave;
if (hasFramePointer())
RegExclude |= RegSet_FramePointer;
- LinearScan.init(Kind);
llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude);
- LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
+ bool Repeat = (Kind == RAK_Global && Ctx->getFlags().shouldRegAllocRepeat());
+ do {
+ LinearScan.init(Kind);
+ LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
+ if (!LinearScan.hasEvictions())
+ Repeat = false;
+ Kind = RAK_SecondChance;
+ } while (Repeat);
}
void TargetLowering::markRedefinitions() {
« src/IceClFlags.h ('K') | « src/IceRegAlloc.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698