about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-13 21:11:12 +0200
committerGitHub <noreply@github.com>2024-08-13 21:11:12 +0200
commitbc9c31df69f05986cd367bbef3a28a2346a32ece (patch)
treee30cb66a3b66700a11a599946787fe3e1b7cf226 /compiler/rustc_codegen_llvm/src/errors.rs
parent80eb5a8e910e5185d47cdefe3732d839c78a5e7e (diff)
parentac88b330b875e8058589b1804ac5d95fcd40905d (diff)
downloadrust-bc9c31df69f05986cd367bbef3a28a2346a32ece.tar.gz
rust-bc9c31df69f05986cd367bbef3a28a2346a32ece.zip
Rollup merge of #122884 - mzabaluev:pow-remove-exit-branch, r=Amanieu
Optimize integer `pow` by removing the exit branch

The branch at the end of the `pow` implementations is redundant with multiplication code already present in the loop. By rotating the exit check, this branch can be largely removed, improving code size and reducing instruction cache misses.

Testing on my machine (`x86_64`, 11th Gen Intel Core i5-1135G7 @ 2.40GHz), the `num::int_pow` benchmarks improve by some 40% for the unchecked operations and show some slight improvement for the checked operations as well.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions