]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Auto merge of #90491 - Mark-Simulacrum:push-pred-faster, r=matthewjasper
authorbors <bors@rust-lang.org>
Wed, 24 Nov 2021 15:51:46 +0000 (15:51 +0000)
committerbors <bors@rust-lang.org>
Wed, 24 Nov 2021 15:51:46 +0000 (15:51 +0000)
commit8a48b376d559f26a9b8fc1f1d597acb0bc0a51f9
treec77aff25fb5247a61368303e67194dac0ff8ebec
parentc6a7ca196a707acd65e6cce1d337cd11786c59a5
parent03afb61b53e27019166b8a2637a5eb7094017300
Auto merge of #90491 - Mark-Simulacrum:push-pred-faster, r=matthewjasper

Optimize live point computation

This refactors the live-point computation to lower per-MIR-instruction costs by operating on a largely per-block level. This doesn't fundamentally change the number of operations necessary, but it greatly improves the practical performance by aggregating bit manipulation into ranges rather than single-bit; this scales much better with larger blocks.

On the benchmark provided in #90445, with 100,000 array elements, walltime for a check build is improved from 143 seconds to 15.

I consider the tiny losses here acceptable given the many small wins on real world benchmarks and large wins on stress tests. The new code scales much better, but on some subset of inputs the slightly higher constant overheads decrease performance somewhat. Overall though, this is expected to be a big win for pathological cases (as illustrated by the test case motivating this work) and largely not material for non-pathological cases. I consider the new code somewhat easier to follow, too.