Recognize countable "break" loops

Rationale:
A particular break loop is generated by e.g. Kotlin
(or it can be expressed in Java as well) if the upper
(or lower) bound is inclusive, but a comparison test
would be too dangerous. The ART compiler often has
better range analysis (e.g. after inlining) to convert
such constructs back to countable loops, which are
more amenable to optimizations. For instance, we get
more than 200% improvement on the KotlinMicroLoops
benchmark, while close to 70 loops are recognized
in the Kotlin support library itself.

Bug: 67601686

Test: test-art-host test-art-target
Change-Id: I67e5c832df57e096efe2cf43a8579d9c10ca33e6
diff --git a/compiler/optimizing/induction_var_analysis.h b/compiler/optimizing/induction_var_analysis.h
index 8737b89..acad77d 100644
--- a/compiler/optimizing/induction_var_analysis.h
+++ b/compiler/optimizing/induction_var_analysis.h
@@ -195,9 +195,14 @@
                                  HInstruction* entry_phi,
                                  HTypeConversion* conversion);
 
+  //
+  // Loop trip count analysis methods.
+  //
+
   // Trip count information.
   void VisitControl(HLoopInformation* loop);
   void VisitCondition(HLoopInformation* loop,
+                      HBasicBlock* body,
                       InductionInfo* a,
                       InductionInfo* b,
                       DataType::Type type,
@@ -219,6 +224,14 @@
                            int64_t stride_value,
                            DataType::Type type,
                            IfCondition cmp);
+  bool RewriteBreakLoop(HLoopInformation* loop,
+                        HBasicBlock* body,
+                        int64_t stride_value,
+                        DataType::Type type);
+
+  //
+  // Helper methods.
+  //
 
   // Assign and lookup.
   void AssignInfo(HLoopInformation* loop, HInstruction* instruction, InductionInfo* info);