Auto merge of #112240 - cjgillot:recurse-inline, r=scottmcm
Only check inlining counter after recursing. This PR aims to reduce the strength of https://github.com/rust-lang/rust/pull/105119 even more. In the current implementation, we check the inline count before recursing. This means that we never actually reach inlining depth 3. This PR checks the counter after recursion, to give a chance to inline at depth >= 3. r? `@scottmcm` cc `@JakobDegen`
This commit is contained in:
commit
9eee230cd0
11 changed files with 395 additions and 271 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue