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
5 files changed