Subzero: Local variable splitting.

The linear-scan register allocator takes an all-or-nothing approach -- either the variable's entire live range gets a register, or none of it does.

To help with this, we add a pass that splits successive uses of a variable within a basic block into a chain of linked variables.  This gives the register allocator the chance to allocate registers to subsets of the original live range.

The split variables are linked to each other so that if they don't get a register, they share a stack slot with the original variable, and redundant writes to that stack slot are recognized and elided.

This pass is executed after target lowering and right before register allocation.  As such, it has to deal with some idiosyncrasies of target lowering, specifically the possibility of intra-block control flow.  We experimented with doing this as a pre-lowering pass.  However, the transformations interfered with some of the target lowering's pattern matching, such as bool folding, so we concluded that post-lowering was a better place for it.

Note: Some of the lit tests are overly specific about registers, and in these cases it was the path of least resistance to just disable local variable splitting.

BUG= none
R=eholk@chromium.org, jpp@chromium.org

Review URL: https://codereview.chromium.org/2177033002 .
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index 43f5e01..ad2a63e 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -321,6 +321,16 @@
   virtual void addProlog(CfgNode *Node) = 0;
   virtual void addEpilog(CfgNode *Node) = 0;
 
+  /// Create a properly-typed "mov" instruction.  This is primarily for local
+  /// variable splitting.
+  virtual Inst *createLoweredMove(Variable *Dest, Variable *SrcVar) {
+    // TODO(stichnot): make pure virtual by implementing for all targets
+    (void)Dest;
+    (void)SrcVar;
+    llvm::report_fatal_error("createLoweredMove() unimplemented");
+    return nullptr;
+  }
+
   virtual ~TargetLowering() = default;
 
 private: