Subzero: Ignore variables with no actual uses.

Liveness analysis uses a pair of bit vectors in each CFG node.  The early bits correspond to "global" variables that are referenced in more than one block, and the latter bits correspond to "local" variables that are referenced in only that particular single block.

Due to an oversight, variables that have no uses are conservatively classified as global, and consume space in every liveness bit vector.

This CL improves memory usage by reducing liveness bit vector size:

1. Identify variables with no actual uses and exclude them from the bit vectors.

2. Don't do liveness analysis on rematerializable variables, because they have no need to be involved in register allocation or dead code elimination.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4366
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1844713004 .
diff --git a/src/IceLiveness.cpp b/src/IceLiveness.cpp
index d9e8e8a..46c834b 100644
--- a/src/IceLiveness.cpp
+++ b/src/IceLiveness.cpp
@@ -50,7 +50,7 @@
     Variable *Var = *I;
     if (VMetadata->isMultiBlock(Var)) {
       ++TmpNumGlobals;
-    } else {
+    } else if (VMetadata->isSingleBlock(Var)) {
       SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex();
       ++Nodes[Index].NumLocals;
     }
@@ -81,18 +81,18 @@
   for (auto I = FirstVar, E = Func->getVariables().end(); I != E; ++I) {
     Variable *Var = *I;
     SizeT VarIndex = Var->getIndex();
-    SizeT LiveIndex;
+    SizeT LiveIndex = InvalidLiveIndex;
     if (VMetadata->isMultiBlock(Var)) {
       LiveIndex = TmpNumGlobals++;
       LiveToVarMap[LiveIndex] = Var;
-    } else {
+    } else if (VMetadata->isSingleBlock(Var)) {
       SizeT NodeIndex = VMetadata->getLocalUseNode(Var)->getIndex();
       LiveIndex = Nodes[NodeIndex].NumLocals++;
       Nodes[NodeIndex].LiveToVarMap[LiveIndex] = Var;
       LiveIndex += NumGlobals;
     }
     VarToLiveMap[VarIndex] = LiveIndex;
-    if (Var->getIgnoreLiveness())
+    if (LiveIndex == InvalidLiveIndex || Var->getIgnoreLiveness())
       RangeMask[VarIndex] = false;
   }
   assert(TmpNumGlobals == (IsFullInit ? NumGlobals : 0));