1
Fork 0

Only check inlining counter after recusing.

This commit is contained in:
Camille GILLOT 2023-06-03 12:23:32 +00:00
parent 0939ec13d8
commit 9e683442a9
11 changed files with 395 additions and 271 deletions

View file

@ -145,13 +145,16 @@ impl<'tcx> Inliner<'tcx> {
Ok(new_blocks) => {
debug!("inlined {}", callsite.callee);
self.changed = true;
inlined_count += 1;
if inlined_count == inline_limit {
return;
}
self.history.push(callsite.callee.def_id());
self.process_blocks(caller_body, new_blocks);
self.history.pop();
inlined_count += 1;
if inlined_count == inline_limit {
debug!("inline count reached");
return;
}
}
}
}