summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/bounds_check_elimination_test.cc
diff options
context:
space:
mode:
authorMingyao Yang <mingyao@google.com>2015-03-23 23:56:36 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-23 23:56:37 +0000
commit27a40aac557a0ee123471a99dc56fe91b50f2351 (patch)
treefb7fcf5673e3d672b68e7a96aceb3a50b191b467 /compiler/optimizing/bounds_check_elimination_test.cc
parent075a6090b07ecfe7394fb65d39567596e0b1e3d3 (diff)
parente295e6ec5beaea31be5d7d3c996cd8cfa2053129 (diff)
downloadart-27a40aac557a0ee123471a99dc56fe91b50f2351.tar.gz
art-27a40aac557a0ee123471a99dc56fe91b50f2351.tar.bz2
art-27a40aac557a0ee123471a99dc56fe91b50f2351.zip
Merge "Deoptimization-based bce."
Diffstat (limited to 'compiler/optimizing/bounds_check_elimination_test.cc')
-rw-r--r--compiler/optimizing/bounds_check_elimination_test.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/compiler/optimizing/bounds_check_elimination_test.cc b/compiler/optimizing/bounds_check_elimination_test.cc
index 24fa58317a..5632f2bd29 100644
--- a/compiler/optimizing/bounds_check_elimination_test.cc
+++ b/compiler/optimizing/bounds_check_elimination_test.cc
@@ -289,9 +289,9 @@ TEST(BoundsCheckEliminationTest, UnderflowArrayBoundsElimination) {
ASSERT_FALSE(IsRemoved(bounds_check));
}
-// array[5] = 1; // Can't eliminate.
-// array[4] = 1; // Can eliminate.
// array[6] = 1; // Can't eliminate.
+// array[5] = 1; // Can eliminate.
+// array[4] = 1; // Can eliminate.
TEST(BoundsCheckEliminationTest, ConstantArrayBoundsElimination) {
ArenaPool pool;
ArenaAllocator allocator(&pool);
@@ -319,35 +319,35 @@ TEST(BoundsCheckEliminationTest, ConstantArrayBoundsElimination) {
HNullCheck* null_check = new (&allocator) HNullCheck(parameter, 0);
HArrayLength* array_length = new (&allocator) HArrayLength(null_check);
- HBoundsCheck* bounds_check5 = new (&allocator)
- HBoundsCheck(constant_5, array_length, 0);
+ HBoundsCheck* bounds_check6 = new (&allocator)
+ HBoundsCheck(constant_6, array_length, 0);
HInstruction* array_set = new (&allocator) HArraySet(
- null_check, bounds_check5, constant_1, Primitive::kPrimInt, 0);
+ null_check, bounds_check6, constant_1, Primitive::kPrimInt, 0);
block->AddInstruction(null_check);
block->AddInstruction(array_length);
- block->AddInstruction(bounds_check5);
+ block->AddInstruction(bounds_check6);
block->AddInstruction(array_set);
null_check = new (&allocator) HNullCheck(parameter, 0);
array_length = new (&allocator) HArrayLength(null_check);
- HBoundsCheck* bounds_check4 = new (&allocator)
- HBoundsCheck(constant_4, array_length, 0);
+ HBoundsCheck* bounds_check5 = new (&allocator)
+ HBoundsCheck(constant_5, array_length, 0);
array_set = new (&allocator) HArraySet(
- null_check, bounds_check4, constant_1, Primitive::kPrimInt, 0);
+ null_check, bounds_check5, constant_1, Primitive::kPrimInt, 0);
block->AddInstruction(null_check);
block->AddInstruction(array_length);
- block->AddInstruction(bounds_check4);
+ block->AddInstruction(bounds_check5);
block->AddInstruction(array_set);
null_check = new (&allocator) HNullCheck(parameter, 0);
array_length = new (&allocator) HArrayLength(null_check);
- HBoundsCheck* bounds_check6 = new (&allocator)
- HBoundsCheck(constant_6, array_length, 0);
+ HBoundsCheck* bounds_check4 = new (&allocator)
+ HBoundsCheck(constant_4, array_length, 0);
array_set = new (&allocator) HArraySet(
- null_check, bounds_check6, constant_1, Primitive::kPrimInt, 0);
+ null_check, bounds_check4, constant_1, Primitive::kPrimInt, 0);
block->AddInstruction(null_check);
block->AddInstruction(array_length);
- block->AddInstruction(bounds_check6);
+ block->AddInstruction(bounds_check4);
block->AddInstruction(array_set);
block->AddInstruction(new (&allocator) HGoto());
@@ -361,9 +361,9 @@ TEST(BoundsCheckEliminationTest, ConstantArrayBoundsElimination) {
RunSimplifierAndGvn(graph);
BoundsCheckElimination bounds_check_elimination(graph);
bounds_check_elimination.Run();
- ASSERT_FALSE(IsRemoved(bounds_check5));
- ASSERT_TRUE(IsRemoved(bounds_check4));
ASSERT_FALSE(IsRemoved(bounds_check6));
+ ASSERT_TRUE(IsRemoved(bounds_check5));
+ ASSERT_TRUE(IsRemoved(bounds_check4));
}
// for (int i=initial; i<array.length; i+=increment) { array[i] = 10; }