summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/induction_var_analysis_test.cc
diff options
context:
space:
mode:
authorAart Bik <ajcbik@google.com>2015-10-14 17:44:55 -0700
committerAart Bik <ajcbik@google.com>2015-10-19 12:44:55 -0700
commitaec3cce52009afe436a6db0280d6d5aee9b8d4d4 (patch)
tree9fa409750d89871863b10396a2278ebd48f0b5b9 /compiler/optimizing/induction_var_analysis_test.cc
parentf69f56e7d4a1e31dfce2a77558c9b7047f82092b (diff)
downloadart-aec3cce52009afe436a6db0280d6d5aee9b8d4d4.tar.gz
art-aec3cce52009afe436a6db0280d6d5aee9b8d4d4.tar.bz2
art-aec3cce52009afe436a6db0280d6d5aee9b8d4d4.zip
Added ability to generate induction range code.
Rationale: used by dynamic BCE (done in another CL). Change-Id: Ia6ce75da57b5298fba74622822ae0bae69c74188
Diffstat (limited to 'compiler/optimizing/induction_var_analysis_test.cc')
-rw-r--r--compiler/optimizing/induction_var_analysis_test.cc31
1 files changed, 0 insertions, 31 deletions
diff --git a/compiler/optimizing/induction_var_analysis_test.cc b/compiler/optimizing/induction_var_analysis_test.cc
index 20492e7152..fd1e334bb6 100644
--- a/compiler/optimizing/induction_var_analysis_test.cc
+++ b/compiler/optimizing/induction_var_analysis_test.cc
@@ -20,7 +20,6 @@
#include "builder.h"
#include "gtest/gtest.h"
#include "induction_var_analysis.h"
-#include "induction_var_range.h"
#include "nodes.h"
#include "optimizing_unit_test.h"
@@ -522,36 +521,6 @@ TEST_F(InductionVarAnalysisTest, FindDerivedPeriodicInduction) {
EXPECT_STREQ("periodic(( - (1)), (0))", GetInductionInfo(neg, 0).c_str());
}
-TEST_F(InductionVarAnalysisTest, FindRange) {
- // Setup:
- // for (int i = 0; i < 100; i++) {
- // k = i << 1;
- // k = k + 1;
- // a[k] = 0;
- // }
- BuildLoopNest(1);
- HInstruction *shl = InsertInstruction(
- new (&allocator_) HShl(Primitive::kPrimInt, InsertLocalLoad(basic_[0], 0), constant1_), 0);
- InsertLocalStore(induc_, shl, 0);
- HInstruction *add = InsertInstruction(
- new (&allocator_) HAdd(Primitive::kPrimInt, InsertLocalLoad(induc_, 0), constant1_), 0);
- InsertLocalStore(induc_, add, 0);
- HInstruction* store = InsertArrayStore(induc_, 0);
- PerformInductionVarAnalysis();
-
- EXPECT_STREQ("((2) * i + (1))", GetInductionInfo(store->InputAt(1), 0).c_str());
-
- InductionVarRange range(iva_);
- InductionVarRange::Value v_min = range.GetMinInduction(store, store->InputAt(1));
- InductionVarRange::Value v_max = range.GetMaxInduction(store, store->InputAt(1));
- ASSERT_TRUE(v_min.is_known);
- EXPECT_EQ(0, v_min.a_constant);
- EXPECT_EQ(1, v_min.b_constant);
- ASSERT_TRUE(v_max.is_known);
- EXPECT_EQ(0, v_max.a_constant);
- EXPECT_EQ(199, v_max.b_constant);
-}
-
TEST_F(InductionVarAnalysisTest, FindDeepLoopInduction) {
// Setup:
// k = 0;