Weight variables for register allocation by their number of uses.
Count the number of instructions that use a variable following the heuristic
that more uses implies higher register priority. This is currently very simple
but is precursor work for weighting variables by loop nest depth.
BUG=
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/1312433004.
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index cf7be3b..5797fdc 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -765,7 +765,7 @@
Str << getVMetadata()->isMultiBlock(Var);
else
Str << "?";
- Str << " weight=" << Var->getWeight() << " ";
+ Str << " weight=" << Var->getWeight(this) << " ";
Var->dump(this);
Str << " LIVE=" << Var->getLiveRange() << "\n";
}