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

Unified Diff: src/IceRegAlloc.cpp

Issue 2172313002: Subzero : Live Range Splitting after initial Register Allocation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add comment Created 4 years, 4 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
« no previous file with comments | « src/IceRegAlloc.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.cpp
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp
index 06631bfe2125b55d5f420bde7c2447cddea780d6..282a544ba888ca8b39e4ba125387e02c03beae26 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -113,7 +113,6 @@ void LinearScan::initForGlobal() {
// register allocation since no overlap opportunities should be available and
// it's more expensive to look for opportunities.
FindOverlap = (Kind != RAK_Phi);
- const VarList &Vars = Func->getVariables();
Unhandled.reserve(Vars.size());
UnhandledPrecolored.reserve(Vars.size());
// Gather the live ranges of all variables and add them to the Unhandled set.
@@ -168,7 +167,6 @@ bool LinearScan::livenessValidateIntervals(
if (!BuildDefs::dump())
return false;
- const VarList &Vars = Func->getVariables();
OstreamLocker L(Ctx);
Ostream &Str = Ctx->getStrDump();
for (SizeT VarNum : DefsWithoutUses) {
@@ -212,7 +210,6 @@ void LinearScan::initForInfOnly() {
FindPreference = false;
FindOverlap = false;
SizeT NumVars = 0;
- const VarList &Vars = Func->getVariables();
// Iterate across all instructions and record the begin and end of the live
// range for each variable that is pre-colored or infinite weight.
@@ -325,13 +322,19 @@ void LinearScan::initForSecondChance() {
}
}
-void LinearScan::init(RegAllocKind Kind) {
+void LinearScan::init(RegAllocKind Kind, CfgSet<Variable *> ExcludeVars) {
this->Kind = Kind;
Unhandled.clear();
UnhandledPrecolored.clear();
Handled.clear();
Inactive.clear();
Active.clear();
+ Vars.clear();
+ Vars.reserve(Func->getVariables().size() - ExcludeVars.size());
+ for (auto *Var : Func->getVariables()) {
+ if (ExcludeVars.find(Var) == ExcludeVars.end())
+ Vars.emplace_back(Var);
+ }
SizeT NumRegs = Target->getNumRegisters();
RegAliases.resize(NumRegs);
« no previous file with comments | « src/IceRegAlloc.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698