summaryrefslogtreecommitdiff
path: root/compiler/optimizing/live_ranges_test.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2016-04-07 09:54:26 +0000
committer David Brazdil <dbrazdil@google.com> 2016-04-07 16:03:16 +0000
commitdee58d6bb6d567fcd0c4f39d8d690c3acaf0e432 (patch)
tree5a2f20546ca3c1544c44bee560062580e22dc79c /compiler/optimizing/live_ranges_test.cc
parent391e155a6936a05bd39b171031ec21d2dee62133 (diff)
Revert "Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals""
This patch merges the instruction-building phases from HGraphBuilder and SsaBuilder into a single HInstructionBuilder class. As a result, it is not necessary to generate HLocal, HLoadLocal and HStoreLocal instructions any more, as the builder produces SSA form directly. Saves 5-15% of arena-allocated memory (see bug for more data): GMS 20.46MB => 19.26MB (-5.86%) Maps 24.12MB => 21.47MB (-10.98%) YouTube 28.60MB => 26.01MB (-9.05%) This CL fixed an issue with parsing quickened instructions. Bug: 27894376 Bug: 27998571 Bug: 27995065 Change-Id: I20dbe1bf2d0fe296377478db98cb86cba695e694
Diffstat (limited to 'compiler/optimizing/live_ranges_test.cc')
-rw-r--r--compiler/optimizing/live_ranges_test.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc
index 3202493c3a..bdaef1d0e9 100644
--- a/compiler/optimizing/live_ranges_test.cc
+++ b/compiler/optimizing/live_ranges_test.cc
@@ -211,8 +211,8 @@ TEST_F(LiveRangesTest, Loop1) {
*
* Which becomes the following graph (numbered by lifetime position):
* 2: constant0
- * 4: constant4
- * 6: constant5
+ * 4: constant5
+ * 6: constant4
* 8: goto
* |
* 12: goto
@@ -247,7 +247,7 @@ TEST_F(LiveRangesTest, Loop1) {
liveness.Analyze();
// Test for the 0 constant.
- LiveInterval* interval = liveness.GetInstructionFromSsaIndex(0)->GetLiveInterval();
+ LiveInterval* interval = graph->GetIntConstant(0)->GetLiveInterval();
LiveRange* range = interval->GetFirstRange();
ASSERT_EQ(2u, range->GetStart());
// Last use is the loop phi so instruction is live until
@@ -256,18 +256,18 @@ TEST_F(LiveRangesTest, Loop1) {
ASSERT_TRUE(range->GetNext() == nullptr);
// Test for the 4 constant.
- interval = liveness.GetInstructionFromSsaIndex(1)->GetLiveInterval();
+ interval = graph->GetIntConstant(4)->GetLiveInterval();
range = interval->GetFirstRange();
// The instruction is live until the end of the loop.
- ASSERT_EQ(4u, range->GetStart());
+ ASSERT_EQ(6u, range->GetStart());
ASSERT_EQ(24u, range->GetEnd());
ASSERT_TRUE(range->GetNext() == nullptr);
// Test for the 5 constant.
- interval = liveness.GetInstructionFromSsaIndex(2)->GetLiveInterval();
+ interval = graph->GetIntConstant(5)->GetLiveInterval();
range = interval->GetFirstRange();
// The instruction is live until the return instruction after the loop.
- ASSERT_EQ(6u, range->GetStart());
+ ASSERT_EQ(4u, range->GetStart());
ASSERT_EQ(26u, range->GetEnd());
ASSERT_TRUE(range->GetNext() == nullptr);