Optimizing: Do not insert suspend checks on back-edges.

Rely on HGraph::SimplifyLoop() to insert suspend checks.

CodeGenerator's CheckLoopEntriesCanBeUsedForOsr() checks the
dex pcs of suspend checks against branch targets to verify
that we always have an appropriate point for OSR transition.
However, the HSuspendChecks that were added by HGraphBuilder
to support the recently removed "baseline" interfered with
this in a specific case, namely an infinite loop where the
back-branch jumps to a nop. In that case, the HSuspendCheck
added by HGraphBuilder had a dex pc different from the block
and the branch target but its presence would stop the
HGraph::SimplifyLoop() from adding a new HSuspendCheck with
the correct dex pc.

Bug: 27623547
Change-Id: I83566a260210bc05aea0c44509a39bb490aa7003
diff --git a/compiler/optimizing/dead_code_elimination_test.cc b/compiler/optimizing/dead_code_elimination_test.cc
index 930795b..83e724b 100644
--- a/compiler/optimizing/dead_code_elimination_test.cc
+++ b/compiler/optimizing/dead_code_elimination_test.cc
@@ -149,44 +149,32 @@
     "  5: IntConstant [9]\n"
     "  13: IntConstant [14]\n"
     "  18: IntConstant [19]\n"
-    "  24: IntConstant [25]\n"
-    "  29: SuspendCheck\n"
-    "  30: Goto 1\n"
+    "  23: IntConstant [24]\n"
+    "  28: SuspendCheck\n"
+    "  29: Goto 1\n"
     "BasicBlock 1, pred: 0, succ: 3\n"
     "  9: Add(3, 5) [19]\n"
     "  11: Goto 3\n"
     "BasicBlock 2, pred: 3, succ: 4\n"
-    "  14: Add(19, 13) [25]\n"
+    "  14: Add(19, 13) [24]\n"
     "  16: Goto 4\n"
     "BasicBlock 3, pred: 1, succ: 2\n"
     "  19: Add(9, 18) [14]\n"
-    "  21: SuspendCheck\n"
-    "  22: Goto 2\n"
+    "  21: Goto 2\n"
     "BasicBlock 4, pred: 2, succ: 5\n"
-    "  25: Add(14, 24)\n"
-    "  27: ReturnVoid\n"
+    "  24: Add(14, 23)\n"
+    "  26: ReturnVoid\n"
     "BasicBlock 5, pred: 4\n"
-    "  28: Exit\n";
+    "  27: Exit\n";
 
-  // The SuspendCheck instruction following this Add instruction
-  // inserts the latter in an environment, thus making it "used" and
-  // therefore non removable.  It ensures that some other Add and
-  // IntConstant instructions cannot be removed, as they are direct
-  // or indirect inputs of the initial Add instruction.
   std::string expected_after =
     "BasicBlock 0, succ: 1\n"
-    "  3: IntConstant [9]\n"
-    "  5: IntConstant [9]\n"
-    "  18: IntConstant [19]\n"
-    "  29: SuspendCheck\n"
-    "  30: Goto 1\n"
+    "  28: SuspendCheck\n"
+    "  29: Goto 1\n"
     "BasicBlock 1, pred: 0, succ: 5\n"
-    "  9: Add(3, 5) [19]\n"
-    "  19: Add(9, 18) []\n"
-    "  21: SuspendCheck\n"
-    "  27: ReturnVoid\n"
+    "  26: ReturnVoid\n"
     "BasicBlock 5, pred: 1\n"
-    "  28: Exit\n";
+    "  27: Exit\n";
 
   TestCode(data, expected_before, expected_after);
 }