History log of /art/test/449-checker-bce/src/Main.java
Revision Date Author Comments
591ad29eb1aa7c5ac7faadb426f5eb2b4a4ccd02 01-Mar-2016 Aart Bik <ajcbik@google.com> Standby list for dyn bce in potentially infinite loops.

Rationale:
The old code relied on "luck" to revisit basic blocks
after dynamic bce and incorporate all bounds checks
in potentially infinite loops that were "made" finite.
Now that revisiting has been removed completely, keeping
a standby list ensures all candidates are considered.

Change-Id: Ida3cf63be1307be6c2b0258d3e64b163f12be235
b6347b7a3dbf9f55cbd638c630e9d044d6d53ac6 29-Feb-2016 Aart Bik <ajcbik@google.com> Fixed bug on incorrectly revisiting same block.

Rationale:
Aart's fuzz tester found this particular bug, where
revisiting a block (after dynamic bce) would cause
static array length based bce to feed into itself
and thus incorrectly remove a needed bounds check.

bug=27376274

Change-Id: I9163f283af355d444b4cec707f194fe2b67c2572
e530539656fd7c95c914885b4f67c404daea2ea2 24-Feb-2016 Aart Bik <ajcbik@google.com> Make sure constantIndexing2 is optimized with DEOPT.

Rationale:
This particular method is also used in foo() to see if
assertIsManaged() holds after going out of bounds.
During my last rewrite (which added a driver to make
sure more code is actually executed), I changed the
method to show a non-deopt case. However, that would
miss this test. I moved the non-deopt case into a new test.

Change-Id: Iaf3e77e33a82ff6cd300753f9e5211529353401c
bf3f1cf15a021ea1ff8ae860c55e8281da4619b3 23-Feb-2016 Aart Bik <ajcbik@google.com> Improved instruction + offset hunting.

Rationale:
This is generally useful for anything using this method
but in particular for deopting something like

bs[ off] = (byte)(n >>> 24);
bs[++off] = (byte)(n >>> 16);
bs[++off] = (byte)(n >>> 8);
bs[++off] = (byte)(n );

where the base + offset is hidden in the increments.
Occurs quite often in real-life code.

Change-Id: I3fa7d285a7368a179a26e590e8eee37f3b64c25d
1d23982327265e8139f67e37d9a86ba2758f7b4a 09-Feb-2016 Aart Bik <ajcbik@google.com> Generalized "dom-based" dynamic BCE to symbolic base + offset.

Rationale:
So far, if all others failed, BCE would use a dominator-based
dynamic deoptimization to eliminate bounds checks in e.g. a[0],
a[1], a[2], etc. This CL generalizes this to any symbolic base
with offset in e.g. a[base], a[base+1], etc. The runtime tests
(two for symbolic, one for constant) carefully account for
arithmetic wrap-around.

bug=26680114

Change-Id: I7432a200fd69791914ed776c77fa62567b5863c0
17fb893c41f2fb2528abbd63e463008d2ddd5d8f 02-Feb-2016 Vladimir Marko <vmarko@google.com> Optimizing: Do not depend on sharpening in test 449.

The sharpening may or may not remove the ArtMethod*
parameter, so the test must not depend on its absence.
This fixes the test 449 checker test on mips/mips64.

Change-Id: I0c9e7353234365c97b622c7c84708be3dcbbe4ff
09e8d5ffe52c738c6a74984b1cbc7ad4bc8f5e2c 23-Jan-2016 Aart Bik <ajcbik@google.com> Some minor simplifications in code and tests.

Background:
This is actually a resubmit of an earlier cl that was
reverted because was test was less robust against
inlining changes (it assumed a virtual call would
never be inlined).

original cl: If8ada79dfd70bea991c11d2b18661b951b6c4cd4
revert cl: I739aaaccd0509d02a62ef01e797a6d45bfe941df

Change-Id: I952680d60ff488874907f066bfdf156a45b409ba
69fd1b56021ac62c17e188bd0d4dd22fc911558e 22-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Some minor simplifications in code and tests."

Fails 530-checker-loops on arm

This reverts commit bf03fcd10a3ffa15468d335f26697b0473e45b36.

Change-Id: I739aaaccd0509d02a62ef01e797a6d45bfe941df
bf03fcd10a3ffa15468d335f26697b0473e45b36 04-Jan-2016 Aart Bik <ajcbik@google.com> Some minor simplifications in code and tests.

Rationale: fell through the cracks of previous "intrinsics" CL.

Change-Id: If8ada79dfd70bea991c11d2b18661b951b6c4cd4
5949fa0cb9a8d26ac20b9b02065a63b4b20443be 18-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Tweak inlining heuristics.""

This reverts commit b17d1ccff0ac26fc22df671907ba2b4f4c656ce4.

Change-Id: I26f6f8702a448c3da12662cbc6bc0f6e562bc40b
5d75afe333f57546786686d9bee16b52f1bbe971 14-Dec-2015 Aart Bik <ajcbik@google.com> Improved side-effects/can-throw information on intrinsics.

Rationale: improved side effect and exception analysis gives
many more opportunities for GVN/LICM/BCE.

Change-Id: I8aa9b757d77c7bd9d58271204a657c2c525195b5
4a34277c55279ba57ab361f7580db846a201d9b1 30-Nov-2015 Aart Bik <ajcbik@google.com> Dynamic BCE (based on induction range analysis)

Rationale:
A rewritten dynamic BCE that uses induction variable analysis
to generate the run-time tests before a loop in order to
eliminate bounds-checks from its body. This CL removes now
obsoleted induction related code inside the BCE module.
Also, the dynamic test generation is placed more strategically,
since we missed a few cases where static analysis does better.

Most significant performance improvements (filtering noise) is about:

Linpack +20%
LU > +10%

Change-Id: I03d7631857154b6a131b132f26a2dc568af1b3a1
d59c70627cc42878cc30b46bd29ff497b4483b22 21-Nov-2015 Aart Bik <ajcbik@google.com> Revert "Dynamic BCE (based on induction range analysis)"

This reverts commit 0b5849be045c5683d4a6b6b6c306abadba5f0fcc.


Change-Id: Id33f5da42bbdfb1aff7e2281417c8a7aa492df05
Rationale: so close :-( but bullhead-userdebug (linux) build in git_mnc-dr-dev-plus-aosp reported a breakage with a type inconsistency (long vs int in probably the codegen of dynamic bce); no time to investigate and fix this fully before my trip, so rolling back for now
0b5849be045c5683d4a6b6b6c306abadba5f0fcc 19-Oct-2015 Aart Bik <ajcbik@google.com> Dynamic BCE (based on induction range analysis)

Rationale: A rewritten dynamic BCE that uses induction variable analysis
to generate the run-time tests before a loop in order to
eliminate bounds-checks from its body. This CL removes now
obsoleted induction related code inside the BCE module.
Also, the dynamic test generation is placed more strategically,
since we missed a few cases where static analysis does better.

Most significant performance improvements (after filtering noise) is about:
Linpack +20%
LU > +10%

Change-Id: I4e7b8bab0288beff6f98a14856e3536103d32742
951779839f0d35ed5336f399c8f521fd9a6b7c27 30-Oct-2015 David Brazdil <dbrazdil@google.com> ART: Enable inlining under try/catch

This patch updates the inliner to set try/catch information
when inlining into a method with try/catch. It does not yet
allow inlining of methods with try/catch because that will
require generating catch stack maps with inline info.

Change-Id: I7d57e1454e7da537d75c5c7eda60b22f3a30fa60
0dfc9bc0cca3ae15dc75bbea3ca9b6d7508ce893 01-Oct-2015 Andreas Gampe <agampe@google.com> ART: Add more deopt tests

Extend libarttest with the ability to turn off asserts for method
state. Use this to put asserts into test functions, but turn them
off if the test wouldn't react as we want, e.g., when we're in
interpreter mode.

Extend run-test 449 by adding asserts for the method state for the
expected deopt cases. This tests both standard behavior, as well
as single-frame deoptimization.

Bug: 21611912
Change-Id: I27fa5e3e44d8c5eab57962d144c6aec96587bf45
639bdd13993644a267f177f8f5936496bda65e2b 03-Jun-2015 Andreas Gampe <agampe@google.com> ART: Single-frame deopt

Add deoptimization of a single frame. Works by removing the managed
code frame and jumping into the quick-to-interpreter bridge, and
the bridge understanding a stored ShadowFrame.

We need a separate fixup pass. For x86, we leave the return address
on the stack so we don't need to push it there.

Bug: 21611912
Change-Id: I06625685ced8b054244f8685ab50b238a705b9d2
681652d8e8a33bc07c5c082a71aea13d0f15e0a0 23-Jul-2015 Mingyao Yang <mingyao@google.com> HDeoptimize should hold values live in env.

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
718493c6c3c8e380663cb8a94e57ce160a6c473f 23-Jul-2015 Mingyao Yang <mingyao@google.com> HDeoptimize should hold values live in env.

Values that are not live in compiled code anymore may still be needed in
interpreter, due to code motion, etc.

Bug: 22665511
Change-Id: I8b85833c5c462f8fe36f86d6026a51b07563995a
6a92a033c33e383541d77607fbe8cd982875d13d 23-Jul-2015 Roland Levillain <rpl@google.com> Cosmetic changes in ART run-tests.

Perform a copyright headers clean up mostly.

Change-Id: I26c855b2f54d0887676d9b9b8281b14b7978ab29
bca381a12965a98e3727e93986dd0a195db500a0 20-May-2015 Mingyao Yang <mingyao@google.com> Fix premature deoptimization if the loop body isn't entered.

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
3584bce5b1f45e5741d3a6ca24884a36320ecb6b 20-May-2015 Mingyao Yang <mingyao@google.com> Fix premature deoptimization if the loop body isn't entered.

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
Change-Id: I2b6de1f22fbc4568ca419f76382ebd87806d9694
a06d66a4ee60926127b9498b7ff0b3e37a24fccf 28-May-2015 David Brazdil <dbrazdil@google.com> ART: Distinguish Checker lines from comments

In order to prevent tests passing due to lines with hard-to-spot
formatting errors begin ignored, e.g. by forgetting the colon after
"//CHECK", Checker will now require its assertions to start with "///"
or "##", respectivelly for Java and Smali. Such lines will never be
ignored and will fail the test unless successfully parsed.

Change-Id: I0da9a8f13eb96d950af8c85df17d1899a853a299
9d750efd66ae7f4b790af3c1ff8de972bbe826d9 27-Apr-2015 Mingyao Yang <mingyao@google.com> BCE: don't add deoptimization if the loop has early exit.

Also make the way to detect loop_body_successor to be
more accurate.

Change-Id: I29680f93396383c478a8f40ad28735e4f3f07c1b
206d6fd6cae5ba8c4d5f0e230111fe77b9d5c0a5 14-Apr-2015 Mingyao Yang <mingyao@google.com> Deoptimization-based BCE for unknown loop bounds.

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
d43b3ac88cd46b8815890188c9c2b9a3f1564648 01-Apr-2015 Mingyao Yang <mingyao@google.com> Revert "Revert "Deoptimization-based bce.""

This reverts commit 0ba627337274ccfb8c9cb9bf23fffb1e1b9d1430.

Change-Id: I1ca10d15bbb49897a0cf541ab160431ec180a006
0ba627337274ccfb8c9cb9bf23fffb1e1b9d1430 24-Mar-2015 Andreas Gampe <agampe@google.com> Revert "Deoptimization-based bce."

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
e295e6ec5beaea31be5d7d3c996cd8cfa2053129 07-Mar-2015 Mingyao Yang <mingyao@google.com> Deoptimization-based bce.

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
4559f000b323b64e4bd179b72cfb788b30b25b23 27-Feb-2015 Mingyao Yang <mingyao@google.com> bce: handle a pattern for circular buffer

Change-Id: Ie54bdd7c044af58deea0d0addaaa8186cabf3532
57e04754d5b7fb3cc99d6b9f70da73cf4c65b416 10-Feb-2015 Mingyao Yang <mingyao@google.com> bce: add support to narrow two MonotonicValueRange's at the same time.

Change-Id: I545da4f375619ce47e01bb5aa5c8b1a4a9d1df41
8c8bad89ff367712a6f5bbf3a5836cd398391067 10-Feb-2015 Mingyao Yang <mingyao@google.com> More checker tests for BCE.

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
0304e182adee81be32c744fd3c0d28add29974ff 31-Jan-2015 Mingyao Yang <mingyao@google.com> Improve bce so that more bounds checks can be eliminated.

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