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

Unified Diff: src/IceCfg.cpp

Issue 652633002: Subzero: Improve performance of liveness analysis and live range construction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix non-debug build Created 6 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
« no previous file with comments | « src/IceCfg.h ('k') | src/IceCfgNode.h » ('j') | src/IceCfgNode.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 83d8e2664cd70cc9b4cea2fcc69e12af943a0a6f..6ef85b2c9c96821f980ca656920df82ebd0b6719 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -205,9 +205,9 @@ void Cfg::liveness(LivenessMode Mode) {
// Collect timing for just the portion that constructs the live
// range intervals based on the end-of-live-range computation, for a
// finer breakdown of the cost.
+ TimerMarker T1(TimerStack::TT_liveRange, this);
// Make a final pass over instructions to delete dead instructions
// and build each Variable's live range.
- TimerMarker T1(TimerStack::TT_liveRange, this);
for (CfgNode *Node : Nodes)
Node->livenessPostprocess(Mode, getLiveness());
if (Mode == Liveness_Intervals) {
@@ -246,7 +246,6 @@ void Cfg::liveness(LivenessMode Mode) {
if (Var->getWeight().isInf())
Var->setLiveRangeInfiniteWeight();
}
- dump();
}
}
@@ -263,14 +262,14 @@ bool Cfg::validateLiveness() const {
if (llvm::isa<InstFakeKill>(Inst))
continue;
InstNumberT InstNumber = Inst->getNumber();
- Variable *Dest = Inst->getDest();
- if (Dest) {
+ if (Variable *Dest = Inst->getDest()) {
// TODO: This instruction should actually begin Dest's live
// range, so we could probably test that this instruction is
// the beginning of some segment of Dest's live range. But
// this wouldn't work with non-SSA temporaries during
jvoung (off chromium) 2014/10/13 20:50:50 with the new flag for non-SSA temporaries, could t
Jim Stichnoth 2014/10/13 23:15:22 Cool, done. There's a minor problem when a phi te
jvoung (off chromium) 2014/10/13 23:38:29 Thanks! Can the TODO be removed then?
Jim Stichnoth 2014/10/14 00:15:01 Oops, done.
// lowering.
- if (!Dest->getLiveRange().containsValue(InstNumber)) {
+ if (!Dest->getIgnoreLiveness() &&
+ !Dest->getLiveRange().containsValue(InstNumber)) {
Valid = false;
Str << "Liveness error: inst " << Inst->getNumber() << " dest ";
Dest->dump(this);
@@ -282,7 +281,8 @@ bool Cfg::validateLiveness() const {
SizeT NumVars = Src->getNumVars();
for (SizeT J = 0; J < NumVars; ++J) {
const Variable *Var = Src->getVar(J);
- if (!Var->getLiveRange().containsValue(InstNumber)) {
+ if (!Var->getIgnoreLiveness() &&
+ !Var->getLiveRange().containsValue(InstNumber)) {
Valid = false;
Str << "Liveness error: inst " << Inst->getNumber() << " var ";
Var->dump(this);
« no previous file with comments | « src/IceCfg.h ('k') | src/IceCfgNode.h » ('j') | src/IceCfgNode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698