summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/live_interval_test.cc
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-04-16 18:31:55 +0100
committerDavid Brazdil <dbrazdil@google.com>2015-04-17 17:13:57 +0100
commit3fc992f9dfe8f49ff350132323cc635f102b7b62 (patch)
treed5fdfaed3d79b435dc0b674d60565f1719b2a416 /compiler/optimizing/live_interval_test.cc
parent81b13f6b5244b664000d4bcad16920aadf3b7e29 (diff)
downloadart-3fc992f9dfe8f49ff350132323cc635f102b7b62.tar.gz
art-3fc992f9dfe8f49ff350132323cc635f102b7b62.tar.bz2
art-3fc992f9dfe8f49ff350132323cc635f102b7b62.zip
ART: Improve range search caching in LiveInterval
Register allocator spends too long in LiveInterval queries. This patch builds on previously introduced caching of range search results to further speed up LiveInterval's Covers and FindIntersectionWith. Only calls which are guaranteed to query the current->GetStart() position are cached. Other calls are replaced with CoversSlow which searches through the entire list of ranges. Change-Id: I84d92b526e174caa70d6477497a06afd85016c4a
Diffstat (limited to 'compiler/optimizing/live_interval_test.cc')
-rw-r--r--compiler/optimizing/live_interval_test.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/optimizing/live_interval_test.cc b/compiler/optimizing/live_interval_test.cc
index 28000c18f8..405f261986 100644
--- a/compiler/optimizing/live_interval_test.cc
+++ b/compiler/optimizing/live_interval_test.cc
@@ -84,13 +84,13 @@ TEST(LiveInterval, Covers) {
{
static constexpr size_t ranges[][2] = {{4, 12}, {14, 16}};
LiveInterval* interval = BuildInterval(ranges, arraysize(ranges), &allocator);
+ ASSERT_FALSE(interval->Covers(0));
ASSERT_TRUE(interval->Covers(4));
ASSERT_TRUE(interval->Covers(11));
- ASSERT_TRUE(interval->Covers(14));
- ASSERT_TRUE(interval->Covers(15));
- ASSERT_FALSE(interval->Covers(0));
ASSERT_FALSE(interval->Covers(12));
ASSERT_FALSE(interval->Covers(13));
+ ASSERT_TRUE(interval->Covers(14));
+ ASSERT_TRUE(interval->Covers(15));
ASSERT_FALSE(interval->Covers(16));
}
}