diff options
| author | bors <bors@rust-lang.org> | 2025-06-28 19:11:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-28 19:11:42 +0000 |
| commit | 11ad40bb839ca16f74784b4ab72596ad85587298 (patch) | |
| tree | 037f8f9ae89d5ca6564a3c7cbd8f621f4c96b1ca /compiler/rustc_mir_transform/src/errors.rs | |
| parent | 7ba34c704529e7fcab80130c3fe40efe415d61b5 (diff) | |
| parent | 2074013f44e4b12a0949182d050d3470bd76e4de (diff) | |
| download | rust-11ad40bb839ca16f74784b4ab72596ad85587298.tar.gz rust-11ad40bb839ca16f74784b4ab72596ad85587298.zip | |
Auto merge of #142625 - cjgillot:inline-nocycle, r=oli-obk
Only compute recursive callees once. Inlining MIR in a cyclic call graph may create query cycles, which are ICEs. The current implementation `mir_callgraph_reachable(inlining_candidate, being_optimized)` checks if calling `inlining_candidate` may cycle back to `being_optimized` that we are currently inlining into. This PR replaces this device with query `mir_callgraph_cyclic(being_optimized)` which searches the call graph for all cycles going back to `being_optimized`, and returns the set of functions involved in those cycles. This is a tradeoff: - in the current implementation, we perform more walks, but shallower; - in this new implementation, we perform fewer walks, but exhaust the graph. I'd have liked to compute this using some kind of SCC, but generic parameters make resolution path-dependent, so usual graph algorithms do not apply.
Diffstat (limited to 'compiler/rustc_mir_transform/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
