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

Unified Diff: src/IceCfgNode.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 | « no previous file | src/IceClFlags.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.cpp
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index c92c9eb49af6f43dedd41739cde1cee4f83db4b0..c7dac53f9d2895a5a6a04732672c37c180e30a9a 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -459,8 +459,11 @@ void CfgNode::advancedPhiLowering() {
// Undo the effect of the phi instruction on this node's live-in set by
// marking the phi dest variable as live on entry.
SizeT VarNum = Func->getLiveness()->getLiveIndex(Dest->getIndex());
- assert(!Func->getLiveness()->getLiveIn(this)[VarNum]);
- Func->getLiveness()->getLiveIn(this)[VarNum] = true;
+ auto &LiveIn = Func->getLiveness()->getLiveIn(this);
+ if (VarNum < LiveIn.size()) {
+ assert(!LiveIn[VarNum]);
+ LiveIn[VarNum] = true;
+ }
Phi->setDeleted();
}
}
@@ -867,15 +870,15 @@ void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum,
Variable *Var = Liveness->getVariable(i, this);
if (LB > LE) {
- Var->addLiveRange(FirstInstNum, LE);
- Var->addLiveRange(LB, LastInstNum + 1);
+ Var->addLiveRange(FirstInstNum, LE, this);
+ Var->addLiveRange(LB, LastInstNum + 1, this);
// Assert that Var is a global variable by checking that its liveness
// index is less than the number of globals. This ensures that the
// LiveInAndOut[] access is valid.
assert(i < Liveness->getNumGlobalVars());
LiveInAndOut[i] = false;
} else {
- Var->addLiveRange(LB, LE);
+ Var->addLiveRange(LB, LE, this);
}
if (i == i1)
++IBB;
@@ -887,7 +890,7 @@ void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum,
i = LiveInAndOut.find_next(i)) {
Variable *Var = Liveness->getVariable(i, this);
if (Liveness->getRangeMask(Var->getIndex()))
- Var->addLiveRange(FirstInstNum, LastInstNum + 1);
+ Var->addLiveRange(FirstInstNum, LastInstNum + 1, this);
}
}
« no previous file with comments | « no previous file | src/IceClFlags.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698