Commit Graph

12 Commits

Author SHA1 Message Date
T0b1
706c44513e init 2023-04-12 03:49:50 +02:00
Amanieu d'Antras
2bd03256b3 Make regalloc2 #![no_std] (#119)
* Make regalloc2 `#![no_std]`

This crate doesn't require any features from the standard library, so it
can be made `no_std` to allow it to be used in environments that can't
use the Rust standard library.

This PR mainly performs the following mechanical changes:
- `std::collections` is replaced with `alloc::collections`.
- `std::*` is replaced with `core::*`.
- `Vec`, `vec!`, `format!` and `ToString` are imported when needed since
  they are no longer in the prelude.
- `HashSet` and `HashMap` are taken from the `hashbrown` crate, which is
  the same implementation that the standard library uses.
- `FxHashSet` and `FxHashMap` are typedefs in `lib.rs` that are based on
  the `hashbrown` types.

The only functional change is that `RegAllocError` no longer implements
the `Error` trait since that is not available in `core`.

Dependencies were adjusted to not require `std` and this is tested in CI
by building against the `thumbv6m-none-eabi` target that doesn't have
`std`.

* Add the Error trait impl back under a "std" feature
2023-03-09 11:25:59 -08:00
Jamey Sharp
1955c6dfb5 Only record vreg definitions when fuzzing (#66)
The `vreg_def_blockparam` and `vreg_def_inst` fields on CFGInfo are only
used in `validate_ssa`, which in turn is only used in the ssagen fuzz
target.

Since these fields are never read in normal usage, initializing them is
entirely wasted effort. According to valgrind/DHAT, when running
`wasmtime compile` on the Sightglass Spidermonkey benchmark, removing
these fields saves about 100M instructions, 23k heap allocations
totalling 40MiB, and 47MiB of writes to the heap.
2022-07-29 10:25:27 -07:00
Amanieu d'Antras
0cb3a8019f Rework the API for outgoing blockparams 2021-12-01 01:43:20 +00:00
Chris Fallin
6d313f2b56 Address review comments: more doc comments and some minor refactorings. 2021-08-30 17:15:37 -07:00
Chris Fallin
caf7274efd Remove unused pred_pos 2021-06-19 11:48:54 -07:00
Chris Fallin
5b47462e0c Loop depth instead of hot/cold, with fast O(n) loop-depth computation. Use this to compute use weights. 2021-05-24 22:09:41 -07:00
Chris Fallin
5b55948feb Check branch-args for conflicts with edge-move placement. 2021-05-13 17:25:11 -07:00
Chris Fallin
095a883814 Fix crit-edge detection logic in CFGInfo analysis 2021-05-09 01:06:59 -07:00
Chris Fallin
b9e89885c4 Error checking: properly signal a crit-edge requirement failure (used for regalloc.rs fuzzer) 2021-05-08 21:48:58 -07:00
Chris Fallin
940c1b719d Changes from review comments. 2021-04-18 13:12:33 -07:00
Chris Fallin
8e923b0ad9 Initial public commit of regalloc2. 2021-04-13 17:40:12 -07:00