Chris Fallin 00dc692489 Allow for reused inputs when the reused vreg is also used as other (normal) uses. (#33)
The "reused input" operand constraint allows for an instruction to have
a def-operand whose allocation is constrained to reuse the same
allocation as one of the uses.

This is useful to express constraints needed for some instruction sets,
like x86, where at the ISA level, one register serves both as an input
and the output.

Unfortunately the way that we lower the constraints to liveranges does
not work if we have the same vreg used both for the reused input and
another input -- it results in impossible-to-solve constraints. For
example, the instruction

```
    alu_op v42 use, v42 use, v43 def reuse(0)
```

would result in an impossible allocation.

This fixes liverange construction to properly handle all uses of the
vreg whose operand is reused, rather than just the one reused operand.
2022-03-18 10:14:27 -07:00
2021-04-18 13:18:18 -07:00
2021-09-13 08:33:17 +01:00
2022-01-11 13:34:50 +00:00
2021-04-13 17:40:12 -07:00
2022-01-11 22:27:15 +00:00
2021-09-03 09:04:20 -07:00
2021-04-13 17:40:12 -07:00

regalloc2: another register allocator

This is a register allocator that started life as, and is about 50% still, a port of IonMonkey's backtracking register allocator to Rust. In many regards, it has been generalized, optimized, and improved since the initial port, and now supports both SSA and non-SSA use-cases.

In addition, it contains substantial amounts of testing infrastructure (fuzzing harnesses and checkers) that does not exist in the original IonMonkey allocator.

See the design overview for (much!) more detail on how the allocator works.

License

This crate is licensed under the Apache 2.0 License with LLVM Exception. This license text can be found in the file LICENSE.

Parts of the code are derived from regalloc.rs: in particular, src/checker.rs and src/domtree.rs. This crate has the same license as regalloc.rs, so the license on these files does not differ.

Description
No description provided
Readme 1.4 MiB
Languages
Rust 100%