about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-06-29 11:56:28 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-06-29 12:16:03 +1000
commit687e391bc3a9682b6fe956a2e39a8a3935047158 (patch)
tree915c26f4375521b29b9c83ae65ae2dd98ae74bf5 /compiler/rustc_codegen_llvm/src
parent9e76fcc468f57a1040a85cc195374923be414401 (diff)
downloadrust-687e391bc3a9682b6fe956a2e39a8a3935047158.tar.gz
rust-687e391bc3a9682b6fe956a2e39a8a3935047158.zip
Avoid constructing an unnecessary `InferCtxt`.
Currently, `search_for_structural_match_violation` constructs an `infcx`
from a `tcx` and then only uses the `tcx` within the `infcx`. This is
wasteful because `infcx` is a big type.

This commit changes it to use the `tcx` directly. When compiling
`pest-2.1.3`, this changes the memcpy stats reported by DHAT for a `check full`
build from this:
```
433,008,916 bytes (100%, 99,787.93/Minstr) in 2,148,668 blocks (100%, 495.17/Minstr), avg size 201.52 bytes
```
to this:
```
101,422,347 bytes (99.98%, 25,243.59/Minstr) in 1,318,407 blocks (99.96%, 328.15/Minstr), avg size 76.93 bytes
```
This translates to a 4.3% reduction in instruction counts.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions