aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/greedy_allocation.py
diff options
context:
space:
mode:
authorLouis Verhaard <louis.verhaard@arm.com>2020-09-16 10:25:28 +0200
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-09-17 08:17:18 +0000
commit1356c2ab034738bcf51822de18911cc499fa2e8e (patch)
tree07f0bf0350d85ae40b1b224c27cff7826f34cdcd /ethosu/vela/greedy_allocation.py
parentc3862c24baa9f141aa4f98b39dd6bd33353521fa (diff)
downloadethos-u-vela-1356c2ab034738bcf51822de18911cc499fa2e8e.tar.gz
MLBEDSW-2377: Greedy allocator improvement
Allocate live ranges with longer life time first. On average this gives better memory usage. Change-Id: Id89e9e36a944169a2f10ce7f6e869397ef0abaf0 Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/greedy_allocation.py')
-rw-r--r--ethosu/vela/greedy_allocation.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/greedy_allocation.py b/ethosu/vela/greedy_allocation.py
index 661644a9..58d948c2 100644
--- a/ethosu/vela/greedy_allocation.py
+++ b/ethosu/vela/greedy_allocation.py
@@ -59,7 +59,7 @@ class GreedyAllocator:
def allocate_live_ranges(self, verbose_allocation, alignment):
lrs = set()
for lr in self.live_ranges.ranges.values():
- lrs.add((lr.start_time, lr.end_time, lr))
+ lrs.add((lr.start_time, -lr.end_time, lr))
lrs = sorted(lrs)