about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-19 02:57:19 +0000
committerbors <bors@rust-lang.org>2023-04-19 02:57:19 +0000
commit9e7f72c57d83a6e64f54b436dc3373871c3c4bb0 (patch)
treeb6292ebfa6480ad67e8f0670cb2090351da5c036 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parentda481403e7e3c91878ef8fe3099c04dbb862a145 (diff)
parentfc27ae14f6d7cba468bdac4e3aa34d336a78b54f (diff)
downloadrust-9e7f72c57d83a6e64f54b436dc3373871c3c4bb0.tar.gz
rust-9e7f72c57d83a6e64f54b436dc3373871c3c4bb0.zip
Auto merge of #110477 - miguelraz:canoodling2-electric-boogaloo, r=compiler-errors
Don't allocate on SimplifyCfg/Locals/Const on every MIR pass

Hey! 👋🏾 This is a first PR attempt to see if I could speed up some rustc internals.

Thought process:

```rust
pub struct SimplifyCfg {
    label: String,
}
```
in [compiler/src/rustc_mir_transform/simplify.rs](https://github.com/rust-lang/rust/blob/7908a1d65496b88626e4b7c193c81d777005d6f3/compiler/rustc_mir_transform/src/simplify.rs#L39) fires multiple times per MIR analysis. This means that a likely string allocation is happening in each of these runs, which may add up, as they are not being  lazily allocated or cached in between the different passes.

...yes, I know that adding a global static array is probably not the future-proof solution, but I wanted to lob this now as a proof of concept to see if it's worth shaving off a few cycles and then making more robust.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions