This PR updates the `UseList` type alias to a `SmallVec` with 4 `Use`s (which are 4 bytes each) rather than 2, because we get 16 bytes of space "for free" in a `SmallVec` on a 64-bit machine. This PR improves the compilation performance of Cranelift by 1% on SpiderMonkey.wasm (measured on a Linux desktop with pinned CPU frequency, and pinned to one core). It's worth noting also that before making these changes, I explored whether it would be possible to put the lists of uses and liveranges in single large backing `Vec`s; the basic reason why we can't do this is that during liverange construction, we append to many lists concurrently. One could use a linked-list arrangement, and in fact RA2 did this early in its development; the separate `SmallVec`s were better for performance overall because the cache locality wins when we traverse the lists many times. It may still be worth investigating use of an arena to allocate the vecs rather than the default heap allocator.
45 lines
1.2 KiB
TOML
45 lines
1.2 KiB
TOML
[package]
|
|
name = "regalloc2"
|
|
version = "0.4.1"
|
|
authors = [
|
|
"Chris Fallin <chris@cfallin.org>",
|
|
"Mozilla SpiderMonkey Developers",
|
|
]
|
|
edition = "2018"
|
|
license = "Apache-2.0 WITH LLVM-exception"
|
|
description = "Backtracking register allocator inspired from IonMonkey"
|
|
repository = "https://github.com/bytecodealliance/regalloc2"
|
|
|
|
[dependencies]
|
|
log = { version = "0.4.8", default-features = false }
|
|
smallvec = { version = "1.6.1", features = ["union"] }
|
|
fxhash = "0.2.1"
|
|
slice-group-by = "0.3.0"
|
|
|
|
# Optional serde support, enabled by feature below.
|
|
serde = { version = "1.0.136", features = ["derive"], optional = true }
|
|
|
|
# The below are only needed for fuzzing.
|
|
libfuzzer-sys = { version = "0.4.2", optional = true }
|
|
|
|
# When testing regalloc2 by itself, enable debug assertions and overflow checks
|
|
[profile.release]
|
|
debug = true
|
|
debug-assertions = true
|
|
overflow-checks = true
|
|
|
|
[features]
|
|
default = []
|
|
|
|
# Enables generation of DefAlloc edits for the checker.
|
|
checker = []
|
|
|
|
# Enables detailed logging which can be somewhat expensive.
|
|
trace-log = []
|
|
|
|
# Exposes the internal API for fuzzing.
|
|
fuzzing = ["libfuzzer-sys", "checker", "trace-log"]
|
|
|
|
# Enables serde for exposed types.
|
|
enable-serde = ["serde"]
|