Rework the switch module in cranelift-frontend in terms of brif (#5644)

Rework the compilation strategy for switch to:
* use brif instead of brz and brnz
* generate tables inline, rather than delyaing them to after the decision tree has been generated
* avoid allocating new vectors by using slices into the sorted contiguous ranges
* avoid generating some unconditional jumps
* output differences in test output using the similar crate for easier debugging
This commit is contained in:
Trevor Elliott
2023-01-27 16:00:40 -08:00
committed by GitHub
parent 0f8393508a
commit b47006d432
3 changed files with 159 additions and 191 deletions

View File

@@ -17,6 +17,9 @@ log = { workspace = true }
hashbrown = { workspace = true, optional = true }
smallvec = { workspace = true }
[dev-dependencies]
similar = { workspace = true }
[features]
default = ["std"]
std = ["cranelift-codegen/std"]