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

1
Cargo.lock generated
View File

@@ -622,6 +622,7 @@ dependencies = [
"cranelift-codegen",
"hashbrown",
"log",
"similar",
"smallvec",
"target-lexicon",
]