diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-06-09 15:02:22 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-06-10 10:48:50 +0100 |
commit | 31d76b42ef5165351499da3f8ee0ac147428c5ed (patch) | |
tree | 4f9cf307923c72f73e4a814662a26406f155c38c /compiler/optimizing/liveness_test.cc | |
parent | 7eb3fa1e03b070c55ecbc814e2e3ae4409cf7b1e (diff) | |
download | art-31d76b42ef5165351499da3f8ee0ac147428c5ed.zip art-31d76b42ef5165351499da3f8ee0ac147428c5ed.tar.gz art-31d76b42ef5165351499da3f8ee0ac147428c5ed.tar.bz2 |
Plug code generator into liveness analysis.
Also implement spill slot support.
Change-Id: If5e28811e9fbbf3842a258772c633318a2f4fafc
Diffstat (limited to 'compiler/optimizing/liveness_test.cc')
-rw-r--r-- | compiler/optimizing/liveness_test.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc index 7a33620..2d0bc39 100644 --- a/compiler/optimizing/liveness_test.cc +++ b/compiler/optimizing/liveness_test.cc @@ -15,6 +15,7 @@ */ #include "builder.h" +#include "code_generator.h" #include "dex_file.h" #include "dex_instruction.h" #include "nodes.h" @@ -48,7 +49,8 @@ static void TestCode(const uint16_t* data, const char* expected) { graph->BuildDominatorTree(); graph->TransformToSSA(); graph->FindNaturalLoops(); - SsaLivenessAnalysis liveness(*graph); + CodeGenerator* codegen = CodeGenerator::Create(&allocator, graph, InstructionSet::kX86); + SsaLivenessAnalysis liveness(*graph, codegen); liveness.Analyze(); std::ostringstream buffer; @@ -69,17 +71,17 @@ static void TestCode(const uint16_t* data, const char* expected) { TEST(LivenessTest, CFG1) { const char* expected = "Block 0\n" - " live in: ()\n" - " live out: ()\n" - " kill: ()\n" + " live in: (0)\n" + " live out: (0)\n" + " kill: (1)\n" "Block 1\n" - " live in: ()\n" - " live out: ()\n" - " kill: ()\n" + " live in: (0)\n" + " live out: (0)\n" + " kill: (0)\n" "Block 2\n" - " live in: ()\n" - " live out: ()\n" - " kill: ()\n"; + " live in: (0)\n" + " live out: (0)\n" + " kill: (0)\n"; // Constant is not used. const uint16_t data[] = ONE_REGISTER_CODE_ITEM( |