Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#96596 - scottmcm:limited-calloc, r=Mark-Simul…
…acrum Tweak the vec-calloc runtime check to only apply to shortish-arrays r? `@Mark-Simulacrum` `@nbdd0121` pointed out in rust-lang#95362 (comment) that LLVM currently doesn't constant-fold the `IsZero` check for long arrays, so that seems like a reasonable justification for limiting it. It appears that it's based on length, not byte size, (https://godbolt.org/z/4s48Y81dP), so that's what I used in the PR. Maybe it's a ["the number of inlining shall be three"](https://youtu.be/s4wnuiCwTGU?t=320) sort of situation. Certainly there's more that could be done here -- that generated code that checks long arrays byte-by-byte is highly suboptimal, for example -- but this is an easy, low-risk tweak.
- Loading branch information