Skip to content

Commit ad389a2

Browse files
same-as-last bundle
1 parent b075528 commit ad389a2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/ion/process.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl<'a, F: Function> Env<'a, F> {
9494
self.ctx.pregs[reg.index()].allocations.btree
9595
);
9696
let mut first_conflict: Option<ProgPoint> = None;
97+
let mut last_conflict_bundle: Option<LiveBundleIndex> = None;
9798

9899
'ranges: for entry in bundle_ranges {
99100
trace!(" -> range LR {:?}: {:?}", entry.index, entry.range);
@@ -158,6 +159,12 @@ impl<'a, F: Function> Env<'a, F> {
158159
// conflicts list.
159160
let conflict_bundle = self.ctx.ranges[*preg_range].bundle;
160161
trace!(" -> conflict bundle {:?}", conflict_bundle);
162+
// Adjacent preg ranges very often belong to the same
163+
// bundle; skip the dedup-set lookup on repeats.
164+
if last_conflict_bundle == Some(conflict_bundle) {
165+
continue 'alloc;
166+
}
167+
last_conflict_bundle = Some(conflict_bundle);
161168
if self.ctx.conflict_set.insert(conflict_bundle) {
162169
conflicts.push(conflict_bundle);
163170
max_conflict_weight = core::cmp::max(

0 commit comments

Comments
 (0)