Remove infinite-loop check: it is not a high enough bound in some pathological cases (e.g., gc::many_live_refs test in wasmtime), and it has served its purpose in testing. We can rely on more detailed assertions, e.g. that splits actually shrink bundles and that bundles evict only lower-priority bundles, instead.

This commit is contained in:
Chris Fallin
2021-06-22 12:06:12 -07:00
parent 245c212289
commit f27abc9c48
3 changed files with 3 additions and 6 deletions

View File

@@ -337,6 +337,8 @@ pub struct Env<'a, F: Function> {
pub num_spillslots: u32,
pub safepoint_slots: Vec<(ProgPoint, SpillSlot)>,
pub allocated_bundle_count: usize,
pub stats: Stats,
// For debug output only: a list of textual annotations at every

View File

@@ -68,6 +68,7 @@ impl<'a, F: Function> Env<'a, F> {
spilled_bundles: vec![],
spillslots: vec![],
slots_by_size: vec![],
allocated_bundle_count: 0,
extra_spillslot: vec![None, None],

View File

@@ -36,15 +36,9 @@ pub enum AllocRegResult {
impl<'a, F: Function> Env<'a, F> {
pub fn process_bundles(&mut self) -> Result<(), RegAllocError> {
let mut count = 0;
while let Some((bundle, reg_hint)) = self.allocation_queue.pop() {
self.stats.process_bundle_count += 1;
self.process_bundle(bundle, reg_hint)?;
count += 1;
if count > self.func.insts() * 50 {
self.dump_state();
panic!("Infinite loop!");
}
}
self.stats.final_liverange_count = self.ranges.len();
self.stats.final_bundle_count = self.bundles.len();