summaryrefslogtreecommitdiffstats
path: root/test/449-checker-bce
Commit message (Collapse)AuthorAgeFilesLines
* HDeoptimize should hold values live in env.Mingyao Yang2015-07-282-0/+24
| | | | | | | | | | Values that are not live in compiled code anymore may still be needed in interpreter, due to code motion, etc. (cherry-picked from commit 718493c6c3c8e380663cb8a94e57ce160a6c473f) Bug: 22665511 Change-Id: I8b85833c5c462f8fe36f86d6026a51b07563995a
* Fix premature deoptimization if the loop body isn't entered.Mingyao Yang2015-06-191-24/+143
| | | | | | | | | | | | | | Add a test between initial_ and end_ to see if the loop body is entered. If the loop body isn't entered at all, we jump to the loop header. Loop header is still executed and is going to test the condition again and loop body won't be entered. This makes sure no deoptimization is triggered if the loop body isn't even entered. Bug: 21034044 (cherry picked from commit 3584bce5b1f45e5741d3a6ca24884a36320ecb6b) Change-Id: I2b6de1f22fbc4568ca419f76382ebd87806d9694
* BCE: don't add deoptimization if the loop has early exit.Mingyao Yang2015-04-261-0/+31
| | | | | | | Also make the way to detect loop_body_successor to be more accurate. Change-Id: I29680f93396383c478a8f40ad28735e4f3f07c1b
* Deoptimization-based BCE for unknown loop bounds.Mingyao Yang2015-04-262-2/+348
| | | | | | | | | | | | | | | | | For loop like: for (int i = start; i < end; i++) { array[i] = 1; } We add the following to the loop pre-header: if (start < 0) deoptimize(); if (end > array.length) deoptimize(); Then we can eliminate bounds-check of array[i] inside the loop. We also take care of indexing with induction variable plus some offsets, like array[i - 1]/array[i + 1] inside the loop, and adjust the condition for deoptimization accordingly. Change-Id: I9e24c6b5e134ff95eff5b5605ff8f95d6546616f
* Revert "Revert "Deoptimization-based bce.""Mingyao Yang2015-04-012-5/+144
| | | | | | This reverts commit 0ba627337274ccfb8c9cb9bf23fffb1e1b9d1430. Change-Id: I1ca10d15bbb49897a0cf541ab160431ec180a006
* Revert "Deoptimization-based bce."Andreas Gampe2015-03-242-144/+5
| | | | | | | | | | This breaks compiling the core image: Error after BCE: art::SSAChecker: Instruction 219 in block 1 does not dominate use 221 in block 1. This reverts commit e295e6ec5beaea31be5d7d3c996cd8cfa2053129. Change-Id: Ieeb48797d451836ed506ccb940872f1443942e4e
* Deoptimization-based bce.Mingyao Yang2015-03-232-5/+144
| | | | | | | | | | | | | | | | | | | A mechanism is introduced that a runtime method can be called from code compiled with optimizing compiler to deoptimize into interpreter. This can be used to establish invariants in the managed code If the invariant does not hold at runtime, we will deoptimize and continue execution in the interpreter. This allows to optimize the managed code as if the invariant was proven during compile time. However, the exception will be thrown according to the semantics demanded by the spec. The invariant and optimization included in this patch are based on the length of an array. Given a set of array accesses with constant indices {c1, ..., cn}, we can optimize away all bounds checks iff all 0 <= min(ci) and max(ci) < array-length. The first can be proven statically. The second can be established with a deoptimization-based invariant. This replaces n bounds checks with one invariant check (plus slow-path code). Change-Id: I8c6e34b56c85d25b91074832d13dba1db0a81569
* Merge "bce: add support to narrow two MonotonicValueRange's at the same time."Mingyao Yang2015-03-031-1/+12
|\
| * bce: add support to narrow two MonotonicValueRange's at the same time.Mingyao Yang2015-02-241-1/+12
| | | | | | | | Change-Id: I545da4f375619ce47e01bb5aa5c8b1a4a9d1df41
* | bce: handle a pattern for circular bufferMingyao Yang2015-03-021-0/+23
|/ | | | Change-Id: Ie54bdd7c044af58deea0d0addaaa8186cabf3532
* More checker tests for BCE.Mingyao Yang2015-02-231-1/+382
| | | | | | | | Also make sure the check on MonotonicValueRange narrow is more strict. Plus some handling on array length division such as array.length/2. Added checker tests for each case. Change-Id: I9f32fc5f6ca1f3da8edec576de66b44d85a50bc6
* Improve bce so that more bounds checks can be eliminated.Mingyao Yang2015-02-093-0/+97
For pattern like "int[] array = new int[size+1]", we record this range for size: [-1, array.length-1] This can eliminate more bounds checks. Also simplify overflow/underflow handling and make it more solid. Enhance instruction simplifier such that if array is a result of NewArray with a constant size, replace array.length with that constant. Plan to move all bce gtests to checker in another change. Change-Id: Ibe7cc7940b68fb6465dc3e0ff3ebdb0fd6487aa9