about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-27 09:00:47 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-28 09:25:01 +1100
commitafc5e1fba5e12da77c6bcb8183c277c6e61de6a3 (patch)
treee67618934ef8ce093b6f93d0d7a6df202f6365fa /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent60bf07a26c88b6ebd2522e5ae9cd1afcfa3887f4 (diff)
downloadrust-afc5e1fba5e12da77c6bcb8183c277c6e61de6a3.tar.gz
rust-afc5e1fba5e12da77c6bcb8183c277c6e61de6a3.zip
Split the `Edges` iterator.
The `Edges` iterator returns `OutlivesConstraint` elements, which are 72
bytes. This is big enough to affect performance. Return
`&OutlivesConstraint` would be better. However, each `Edges` iterator is
really one of two different iterators. The "from graph" case does a
graph traversal and could return `&OutlivesConstraint`. But the "from
static" case just does a `0..n` iteration and constructs a new
`OutlivesConstraint` from that, so it can't return a reference.

This commit splits `Edges into `EdgesFromGraph` and `EdgesFromStatic`,
which allows them to have different return types. This is a perf win for
the `wg-grammar` benchmark.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions