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

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: Don't count a use if used as dest. 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..11fae679138bd06389bdcae5e42958ee2cb9aebe 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -203,7 +203,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);
Jim Stichnoth 2015/08/27 05:03:06 So there's kind of a maybe sort of big problem her
jvoung (off chromium) 2015/08/27 18:34:27 Good point =) So the TODO was almost done ;-) Se
Jim Stichnoth 2015/08/27 20:04:21 Actually, incrementing the use count right at the
ascull 2015/08/28 19:26:36 Moved into VMetadata.
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