Subzero: Refactor tracking of Defs and block-local Variables.

This affects tracking of two kinds of Variable metadata: whether a
Variable is block-local (i.e., all uses are in a single block) and if
so, which CfgNode that is; and whether a Variable has a single defining
instruction, and if so, which Inst that is.

Originally, this metadata was constructed incrementally, which was
quite fragile and most likely inaccurate under many circumstances.

In the new approach, this metadata is reconstructed in a separate pass
as needed.

As a side benefit, the metadata fields are removed from each Variable
and pulled into a separate structure, shrinking the size of Variable.

There should be no functional changes, except that simple stack slot
coalescing is turned off under Om1, since it takes a separate pass to
calculate block-local variables, and passes are minimized under Om1.
As a result, a couple of the lit tests needed to be changed.

There are a few non-mechanical changes, generally to tighten up
Variable tracking for liveness analysis.

This is being done mainly to get precise Variable definition
information so that register allocation can infer the best register
preferences as well as when overlapping live ranges are allowable.

BUG=none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/589003002
diff --git a/src/IceCfg.h b/src/IceCfg.h
index 7a265ad..73dd814 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -63,17 +63,15 @@
   // Manage Variables.
   // Create a new Variable with a particular type and an optional
   // name.  The Node argument is the node where the variable is defined.
-  template <typename T>
-  T *makeVariable(Type Ty, const CfgNode *Node, const IceString &Name = "") {
+  template <typename T> T *makeVariable(Type Ty, const IceString &Name = "") {
     SizeT Index = Variables.size();
-    T *Var = T::create(this, Ty, Node, Index, Name);
+    T *Var = T::create(this, Ty, Index, Name);
     Variables.push_back(Var);
     return Var;
   }
   // TODO(stichnot): Remove this function with C++11, and use default
   // argument <typename T=Variable> above.
-  Variable *makeVariable(Type Ty, const CfgNode *Node,
-                         const IceString &Name = "");
+  Variable *makeVariable(Type Ty, const IceString &Name = "");
   SizeT getNumVariables() const { return Variables.size(); }
   const VarList &getVariables() const { return Variables; }
 
@@ -81,9 +79,12 @@
   void addArg(Variable *Arg);
   const VarList &getArgs() const { return Args; }
   VarList &getArgs() { return Args; }
+  void addImplicitArg(Variable *Arg);
+  const VarList &getImplicitArgs() const { return ImplicitArgs; }
 
   // Miscellaneous accessors.
   TargetLowering *getTarget() const { return Target.get(); }
+  VariablesMetadata *getVMetadata() const { return VMetadata.get(); }
   Liveness *getLiveness() const { return Live.get(); }
   bool hasComputedFrame() const;
 
@@ -161,8 +162,10 @@
   InstNumberT NextInstNumber;
   VarList Variables;
   VarList Args; // subset of Variables, in argument order
+  VarList ImplicitArgs; // subset of Variables
   llvm::OwningPtr<Liveness> Live;
   llvm::OwningPtr<TargetLowering> Target;
+  llvm::OwningPtr<VariablesMetadata> VMetadata;
 
   // CurrentNode is maintained during dumping/emitting just for
   // validating Variable::DefNode.  Normally, a traversal over