Subzero: Prune unreachable nodes after constructing the Cfg.

The gcc torture test suite has examples where there is a function call (to a routine that throws an exception or aborts or something), followed by an "unreachable" instruction, followed by more code that may e.g. return a value to the caller.  In these examples, the code following the unreachable is itself unreachable.

Problems arise when the unreachable code references a variable defined in the reachable code.  This triggers a liveness consistency error because the use of the variable has no reaching definition.

It's a bit surprising that LLVM actually allows this, but it does so we need to deal with it.

The solution is, after initial CFG construction, do a traversal starting from the entry node and then delete any undiscovered nodes.

There is code in Subzero that assumes Cfg::Nodes[i]->Number == i, so the nodes need to be renumbered after pruning.  The alternative was to set Nodes[i]=nullptr and not change the node number, but that would mean peppering the code base with CfgNode null checks.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/1027933002
diff --git a/src/IceCfg.h b/src/IceCfg.h
index b4c3748..8f74d07 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -135,9 +135,9 @@
   // Passes over the CFG.
   void translate();
   // After the CFG is fully constructed, iterate over the nodes and
-  // compute the predecessor edges, in the form of
-  // CfgNode::InEdges[].
-  void computePredecessors();
+  // compute the predecessor and successor edges, in the form of
+  // CfgNode::InEdges[] and CfgNode::OutEdges[].
+  void computeInOutEdges();
   void renumberInstructions();
   void placePhiLoads();
   void placePhiStores();