Commit Graph

75 Commits

Author SHA1 Message Date
Nick Fitzgerald
090d1c2d32 cranelift: Port most of simple_preopt.rs over to the peepmatic DSL
This ports all of the identity, no-op, simplification, and canonicalization
related optimizations over from being hand-coded to the `peepmatic` DSL. This
does not handle the branch-to-branch optimizations or most of the
divide-by-constant optimizations.
2020-05-14 07:52:23 -07:00
Benjamin Bouvier
4f919c6460 machinst: bump regalloc to 0.0.23 and return a slice on the successor indexes, in block_succs; 2020-05-07 12:24:02 +02:00
Julian Seward
48521393ae Update to regalloc.rs version 0.22. 2020-05-06 20:16:31 +02:00
Benjamin Bouvier
fa54422854 Add a work-in-progress backend for x86_64 using the new instruction selection;
Most of the work is credited to Julian Seward.

Co-authored-by: Julian Seward <jseward@acm.org>
Co-authored-by: Chris Fallin <cfallin@mozilla.com>
2020-05-05 16:35:41 +02:00
Dan Gohman
864cf98c8d Update release notes, wasmtime 0.16, cranelift 0.63. 2020-04-29 17:30:25 -07:00
Chris Fallin
be6f060abf Use new regalloc.rs version with dense vreg->rreg maps.
This PR updates Cranelift to use the new version of regalloc.rs
(bytecodealliance/regalloc.rs#55) that provides dense vreg->rreg maps to
the `map_reg()` function for each instruction, rather than the earlier
hashmap-based approach.

In one test (regex-rs.wasm), this PR results in a 15% reduction in
memory allocations (1245MB -> 1060MB) as measured by DHAT on `clif-util
wasm` runs.
2020-04-29 10:42:25 -07:00
Benjamin Bouvier
983c2a0873 Bump regalloc.rs to 0.0.20; 2020-04-29 13:38:30 +02:00
Chris Fallin
b691770faa MachInst backend: pass through SourceLoc information.
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.
2020-04-24 13:18:01 -07:00
Chris Fallin
48cf2c2f50 Address review comments:
- Undo temporary changes to default features (`all-arch`) and a
  signal-handler test.
- Remove `SIGTRAP` handler: no longer needed now that we've found an
  "undefined opcode" option on ARM64.
- Rename pp.rs to pretty_print.rs in machinst/.
- Only use empty stack-probe on non-x86. As per a comment in
  rust-lang/compiler-builtins [1], LLVM only supports stack probes on
  x86 and x86-64. Thus, on any other CPU architecture, we cannot refer
  to `__rust_probestack`, because it does not exist.
- Rename arm64 to aarch64.
- Use `target` directive in vcode filetests.
- Run the flags verifier, but without encinfo, when using new backends.
- Clean up warning overrides.
- Fix up use of casts: use u32::from(x) and siblings when possible,
  u32::try_from(x).unwrap() when not, to avoid silent truncation.
- Take immutable `Function` borrows as input; we don't actually
  mutate the input IR.
- Lots of other miscellaneous cleanups.

[1] cae3e6ea23/src/probestack.rs (L39)
2020-04-15 17:21:28 -07:00
Chris Fallin
d83574261c ARM64 backend, part 3 / 11: MachInst infrastructure.
This patch adds the MachInst, or Machine Instruction, infrastructure.
This is the machine-independent portion of the new backend design. It
contains the implementation of the "vcode" (virtual-registerized code)
container, the top-level lowering algorithm and compilation pipeline,
and the trait definitions that the machine backends will fill in.

This backend infrastructure is included in the compilation of the
`codegen` crate, but it is not yet tied into the public APIs; that patch
will come last, after all the other pieces are filled in.

This patch contains code written by Julian Seward <jseward@acm.org> and
Benjamin Bouvier <public@benj.me>, originally developed on a side-branch
before rebasing and condensing into this patch series. See the `arm64`
branch at `https://github.com/cfallin/wasmtime` for original development
history.

Co-authored-by: Julian Seward <jseward@acm.org>
Co-authored-by: Benjamin Bouvier <public@benj.me>
2020-04-11 17:51:11 -07:00
Dan Gohman
fde5ddf159 Fixes for 0.15 (#1449)
* Wasmtime 0.15.0 and Cranelift 0.62.0. (#1398)

* Bump more ad-hoc versions.

* Add build.rs to wasi-common's Cargo.toml.

* Update the env var name in more places.

* Remove a redundant echo.
2020-04-03 13:13:37 -07:00
Dan Gohman
6fa9be7767 Wasmtime 0.13.0 and Cranelift 0.61.0. (#1398)
This also updates the publishing scripts to work with newly added
and reorganized crates.
2020-03-26 13:19:02 -07:00
Alex Crichton
5bd03d282f Update a number of wasmtime's dependencies (#1355)
* Run `cargo update`
* Use `cargo outdated` to guide some manual version bumps
2020-03-18 14:15:33 -05:00
Nathan Froyd
af709ded94 bump cranelift version to 0.60.0 (#1328) 2020-03-17 15:29:20 -04:00
Till Schneidereit
8f824a9fc1 Update outdated references to the Cranelift repository
This patch updates or removes all references to the Cranelift repository. It affects links in README documents, issues that were transferred to the Wasmtime repository, CI badges, and a small bunch of sundry items.
2020-03-09 14:06:24 +01:00
Alex Crichton
3179dcf6f1 Update Cranelift's documentation after the merger. (#1238)
Update the documentation for the merger, and also for various changes in
Cranelift. Remove some old obsolete documentation, and convert the remaining
Sphinx files to Markdown. Some of the remaining content is still out of
date, but this is a step forward.
2020-03-05 15:51:12 -06:00
Alex Crichton
5f1cba0b7f Hook up all crates via path dependencies 2020-02-28 09:16:05 -08:00
Dan Gohman
0a11736fbf Bump version to 0.59.0 (#1406) 2020-02-24 15:10:08 -08:00
Dan Gohman
376654bdfc Bump version to 0.58.0 (#1382) 2020-02-07 13:58:06 -08:00
Nick Fitzgerald
19a188789b Bump to 0.57.0 (#1375)
* Update wasmparser to 0.48.2

* Bump to version 0.57.0
2020-02-04 16:18:59 +01:00
Ryan Hunt
c360007b19 Drop 'basic-blocks' feature (#1363)
* All: Drop 'basic-blocks' feature

This makes it so that 'basic-blocks' cannot be disabled and we can
start assuming it everywhere.

* Tests: Replace non-bb filetests with bb version

* Tests: Adapt solver-fixedconflict filetests to use basic blocks
2020-01-23 22:36:06 -07:00
bjorn3
cc50e65f31 Update gimli to 0.20 (#1361) 2020-01-22 11:25:35 -08:00
Dan Gohman
80d11e3f8d Bump version to 0.56.0 (#1356) 2020-01-17 14:33:52 -08:00
Dan Gohman
b00a181824 Bump version to 0.55.0 (#1345) 2020-01-14 13:04:11 -08:00
Yury Delendik
bd88155483 Refactor unwind; add FDE support. (#1320)
* Refactor unwind

* add FDE support

* use sink directly in emit functions

* pref off all unwinding generation with feature
2020-01-13 10:32:55 -06:00
Dan Gohman
582e7942f8 Bump version to 0.54.0 (#1333) 2020-01-10 14:08:07 -08:00
Philip Craig
43f1e05156 Update target-lexicon to 0.10 2020-01-10 11:30:12 +01:00
Benjamin Bouvier
ac8a952a6b Bump version to 0.52.0 2019-12-18 12:37:08 +01:00
Dan Gohman
b4528beaf5 Bump version to 0.51.0 (#1250) 2019-11-20 22:40:55 -08:00
Benjamin Bouvier
9080a02e10 Replace CraneStation by bytecodealliance everywhere; (#1221) 2019-11-12 10:09:31 -08:00
Peter Huene
4ccf0fdfa3 Fix build errors in x86 unwind info when building no_std. (#1214)
This commit fixes the build errors in the unwind info implementation for
the x86 ABI by changing `byteorder` to build `no_std`.

This copies two simple functions from the `WriteBytesExt` trait so that
we can easily write to a `Vec<u8>` with a particular endianness.

Fixes #1203.
2019-11-07 16:41:32 -08:00
Dan Gohman
cf82863ea9 Bump version to 0.49.0 (#1208) 2019-11-06 14:38:46 -08:00
m4b
d5fb482524 build: update everything to target-lexicon 0.9; 2019-11-06 12:50:14 +01:00
Dan Gohman
45fb377457 Bump version to 0.48.0 (#1202)
* Bump version to 0.48.0

* Re-enable `byteorder`'s default features.

The code uses `WriteBytesExt` which depends on the `std` feature being
enabled. So for now, just enable `std`.
2019-11-05 13:59:19 -08:00
Peter Huene
8923bac7e8 Implement emitting Windows unwind information for fastcall functions. (#1155)
* Implement emitting Windows unwind information for fastcall functions.

This commit implements emitting Windows unwind information for x64 fastcall
calling convention functions.

The unwind information can be used to construct a Windows function table at
runtime for JIT'd code, enabling stack walking and unwinding by the operating
system.

* Address code review feedback.

This commit addresses code review feedback:

* Remove unnecessary unsafe code.
* Emit the unwind information always as little endian.
* Fix comments.

A dependency from cranelift-codegen to the byteorder crate was added.
The byteorder crate is a no-dependencies crate with a reasonable
abstraction for writing binary data for a specific endianness.

* Address code review feedback.

* Disable default features for the `byteorder` crate.
* Add a comment regarding the Windows ABI unwind code numerical values.
* Panic if we encounter a Windows function with a prologue greater than 256
  bytes in size.
2019-11-05 13:14:30 -08:00
Dan Gohman
a9868de3d8 Bump version to 0.47.0 2019-11-04 15:43:27 -08:00
dependabot-preview[bot]
811b5e0a7b Update smallvec requirement from 0.6.10 to 1.0.0
Updates the requirements on [smallvec](https://github.com/servo/rust-smallvec) to permit the latest version.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.10...v1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-04 15:08:27 +01:00
Josh Triplett
7e725cf880 Migrate from failure to thiserror
The failure crate invents its own traits that don't use
std::error::Error (because failure predates certain features added to
Error); this prevents using ? on an error from failure in a function
using Error. The thiserror crate integrates with the standard Error
trait instead.
2019-10-30 17:15:09 -07:00
Nicolas B. Pierron
69d2f40c10 Fix #796: Enable basic-blocks by default. 2019-10-17 14:00:40 +02:00
Dan Gohman
50b7d2827d Bump version to 0.46.1 2019-10-15 11:11:48 -07:00
Dan Gohman
ac4e93f971 Bump version to 0.46.0 2019-10-15 09:43:28 -07:00
Dan Gohman
ece9450a2f Bump version to 0.45.0 2019-10-09 06:20:30 -07:00
bjorn3
74556d45ae Remove std feature from cranelift-codegen-meta 2019-10-02 11:50:44 -07:00
bjorn3
a114423d0a Remove std feature from cranelift-entity 2019-10-02 11:50:44 -07:00
bjorn3
d25e611946 Remove std feature from cranelift-bforest 2019-10-02 11:50:44 -07:00
Joshua Nelson
a1f6457e8a Allow building without std (#1069)
Closes https://github.com/CraneStation/cranelift/issues/1067
2019-09-26 18:00:03 +02:00
Dan Gohman
dfdd504edc Bump version to 0.44.0 2019-09-24 16:28:17 -07:00
Andrew Brown
c648fa3d06 Move condcodes.rs to a new crate, cranelift-codegen-shared
This move allows the `IntCC`/`FloatCC` enums to be used in both meta (for predicate matching) and in codegen. To avoid breaking any code dependent on the previous location of condcodes.rs (`cranelift-codegen/src/condcodes.rs`), the module is re-exported under `cranelift_codegen::ir`.
2019-09-24 09:33:07 -07:00
Dan Gohman
411545ed9a Bump version to 0.43.1 2019-09-20 14:11:15 -07:00
Dan Gohman
5c5eabb8d0 Bump version to 0.43.0 2019-09-19 12:23:51 -07:00