You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #55871 - ljedrz:llvm_back_allocations, r=<try>
codegen_llvm_back: improve allocations
This commit was split out from #54864. Last time it was causing an LLVM OOM, presumably due to aggressive preallocation strategy in `thin_lto`.
This time preallocations are more cautious and there are a few additional memory-related improvements (last 3 points from the list below).
- _gently_ preallocate vectors of known length
- `extend` instead of `append` where the argument is consumable
- turn 2 `push` loops into `extend`s
- create a vector from a function producing one instead of using `extend_from_slice` on it
- consume `modules` when no longer needed
- return an `impl Iterator` from `generate_lto_work`
- don't `collect` `globals`, as they are iterated over and consumed right afterwards
While I'm hoping it won't cause an OOM anymore, I would still consider this a "high-risk" PR and not roll it up.
0 commit comments