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

Unified Diff: src/IceInst.cpp

Issue 1312433004: Weight variables by their number of uses for register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Tidy up lose ends. 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/IceCfgNode.cpp ('k') | src/IceLiveness.cpp » ('j') | src/IceOperand.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index 4b89eb77b0fa88f5f692f637a5ef892305b1a62b..252cd51fd6bfb746eea2a0959ff6f5d6023d1848 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -179,6 +179,8 @@ bool Inst::liveness(InstNumberT InstNumber, LivenessBV &Live,
Dead = false;
if (Dest) {
+ // TODO(ascull): get the loop nest depth
+ Dest->addUse(1);
SizeT VarNum = Liveness->getLiveIndex(Dest->getIndex());
if (Live[VarNum]) {
if (!isDestNonKillable()) {
@@ -203,7 +205,9 @@ bool Inst::liveness(InstNumberT InstNumber, LivenessBV &Live,
Operand *Src = getSrc(I);
SizeT NumVars = Src->getNumVars();
for (SizeT J = 0; J < NumVars; ++J, ++VarIndex) {
- const Variable *Var = Src->getVar(J);
+ Variable *Var = Src->getVar(J);
+ // TODO(ascull): get the loop nest depth
+ Var->addUse(1);
SizeT VarNum = Liveness->getLiveIndex(Var->getIndex());
if (!Live[VarNum]) {
setLastUse(VarIndex);
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceLiveness.cpp » ('j') | src/IceOperand.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698