Optimize tensor allocation verification

By not comparing items that have already been compared with
each other, the number of iterations for the loop is reduced.
For large network with long live ranges, this improves compile
time significantly.

Signed-off-by: Johan Alfven <johan.alfven@arm.com>
Change-Id: I298cd6f109527fc32f6db77ffffca9e765a84ce0
diff --git a/ethosu/vela/tensor_allocation.py b/ethosu/vela/tensor_allocation.py
index db261ae..c82140c 100644
--- a/ethosu/vela/tensor_allocation.py
+++ b/ethosu/vela/tensor_allocation.py
@@ -96,8 +96,9 @@
         for t in range(lr.start_time, lr.end_time + 1):
             lrs_at_time[t].append(lr)
     for t in range(nr_time_slots):
-        for ix, n in enumerate(lrs_at_time[t]):
-            for m in lrs_at_time[t][ix + 1 :]:
+        lrs_new_items = [lr for lr in lrs_at_time[t] if t == 0 or lr not in lrs_at_time[t - 1]]
+        for m in lrs_new_items:
+            for n in lrs_at_time[t]:
                 overlap, tens_n, tens_m = n.overlaps_address(m)
                 if overlap and not (tens_n.equivalent(tens_m) and tens_n.address == tens_m.address):
                     raise AllocationError(