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

Unified Diff: src/IceCfgNode.cpp

Issue 1271923002: Subzero: Slight improvement to phi lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add a TODO Created 5 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/IceCfg.cpp ('k') | src/IceInst.cpp » ('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 f319041c6646103fa9d24367b44e214123b9707c..44e9d3e289f527802fc7eddfbabde8302386a7cf 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -580,6 +580,8 @@ bool CfgNode::liveness(Liveness *Liveness) {
Live |= Liveness->getLiveIn(Succ);
// Mark corresponding argument of phis in successor as live.
for (Inst &I : Succ->Phis) {
+ if (I.isDeleted())
+ continue;
auto Phi = llvm::dyn_cast<InstPhi>(&I);
Phi->livenessPhiOperand(Live, this, Liveness);
}
@@ -698,6 +700,9 @@ void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum,
InstNumberT LE = i == i2 ? IEB->second : LastInstNum + 1;
Variable *Var = Liveness->getVariable(i, this);
+ // TODO(stichnot): Push getIgnoreLiveness() into the initialization of
+ // Liveness::RangeMask so that LiveBegin and LiveEnd never even reference
+ // such variables.
if (!Var->getIgnoreLiveness()) {
if (LB > LE) {
Var->addLiveRange(FirstInstNum, LE, 1);
@@ -720,7 +725,8 @@ void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum,
for (int i = LiveInAndOut.find_first(); i != -1;
i = LiveInAndOut.find_next(i)) {
Variable *Var = Liveness->getVariable(i, this);
- Var->addLiveRange(FirstInstNum, LastInstNum + 1, 1);
+ if (Liveness->getRangeMask(Var->getIndex()))
+ Var->addLiveRange(FirstInstNum, LastInstNum + 1, 1);
}
}
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698