OSDN Git Service

Improve bce so that more bounds checks can be eliminated.
authorMingyao Yang <mingyao@google.com>
Sat, 31 Jan 2015 00:41:29 +0000 (16:41 -0800)
committerMingyao Yang <mingyao@google.com>
Mon, 9 Feb 2015 18:53:16 +0000 (10:53 -0800)
commit0304e182adee81be32c744fd3c0d28add29974ff
tree1fb1a8730d94222e79e8525b5f887c6816d6833d
parent2a3611feeb12bd73ccdbb4692f9ca3705f925d56
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
compiler/optimizing/bounds_check_elimination.cc
compiler/optimizing/bounds_check_elimination_test.cc
compiler/optimizing/instruction_simplifier.cc
test/449-checker-bce/expected.txt [new file with mode: 0644]
test/449-checker-bce/info.txt [new file with mode: 0644]
test/449-checker-bce/src/Main.java [new file with mode: 0644]