]> git.lizzy.rs Git - rust.git/commit
Avoid triggering a pathological case in the LLVM inliner
authorBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 11 Sep 2015 14:37:52 +0000 (16:37 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 11 Sep 2015 14:43:05 +0000 (16:43 +0200)
commit9104a902c052c1ad7fd5c1245cb1e03f88aa2f70
treef5a8e33b951c35f93adddbfc0fe366a354bb080d
parente3fd444dc99dd478fbad0b26ce40d28833a0a9d3
Avoid triggering a pathological case in the LLVM inliner

When the inliner has to decided if it wants to inline a function A into an
internal function B, it first checks whether it would be more profitable
to inline B into its callees instead. This means that it has to analyze
B, which involves checking the assumption cache. Building the assumption
cache requires scanning the whole function, and because inlining
currently clears the assumption cache, this scan happens again and
again, getting even slower as the function grows from inlining.

As inlining the huge find functions isn't really useful anyway, we can
mark them as noinline, which skips the cost analysis and reduces compile
times by as much as 70%.

cc #28273
src/librustc_platform_intrinsics/aarch64.rs
src/librustc_platform_intrinsics/arm.rs
src/librustc_platform_intrinsics/x86.rs