Commit Graph

2204 Commits

Author SHA1 Message Date
Dan Gohman
14dfc0d1b6 Bump version to 0.23.0. 2018-11-07 16:18:04 -08:00
Dan Gohman
ad8a19c7ff Update no_std support. 2018-11-07 16:14:11 -08:00
Dan Gohman
38e8667f97 Adjust whitespace to match the upstream exception text.
This is a whitespace-only change.
2018-11-07 16:07:51 -08:00
Dan Gohman
19dc75f45a Add preopt to the maintainer scripts. 2018-11-07 16:07:51 -08:00
Dan Gohman
fd875c3f5a Pass TargetFrontendConfig by value rather than by reference. 2018-11-07 16:01:15 -08:00
Dan Gohman
b476f823d4 Update to target_lexicon 0.2.0. 2018-11-07 16:01:15 -08:00
Lachlan Sneff
3409af7c07 Add early-stage optimization crate (#556)
* Add simple constant folding and folding tests
2018-11-07 15:59:29 -08:00
Dan Gohman
bdcc06eb15 When lowering br_table to branches, delete the old jump tables.
This prevents codegen from emitting unused readonly data.
2018-11-07 11:49:51 +01:00
Dan Gohman
997424a4c5 Add more comments explaining ghost instructions. 2018-11-07 11:03:23 +01:00
Dan Gohman
26da67b394 Add a verifier check that ghost instructions don't have encodings. 2018-11-07 11:03:23 +01:00
Dan Gohman
88bbbca6cd Make regalloc visit fallthrough_return instructions.
Add an explicit "is_ghost" property to selected instructions, and use
that to determine whether reload and coloring should visit instructions.
This allows them to visit fallthrough_return instructions and insert
fills and register moves as needed.
2018-11-07 11:03:23 +01:00
Dan Gohman
681cb5e20a Assert that the non-fixed inputs to return match the function's signature. 2018-11-07 10:51:19 +01:00
Dan Gohman
05c0b3bdd1 Insert copies to support a value being used as multiple return values.
When one value is used multiple times for separate return values, we
need to copy it to produce a new value, so that each value can be
allocated a different register.
2018-11-07 10:51:19 +01:00
Dan Gohman
5ea6c57b95 Update to the new wasmparser and port to the new readers API.
The new wasmparser API provides dedicated reader types for each section
type, which significantly simplifies the code.

This also changes WasmError::from_binary_reader_error into a From
trait so that we don't have to do .map_err(from_binary_reader_error)
throughout the code.
2018-11-06 15:54:17 -08:00
Dan Gohman
9e084dbadc Update to wabt 0.7.0. 2018-11-06 13:24:45 -08:00
Benjamin Bouvier
bcbb2d01cc [build] Stop using Python code to generate the register files; 2018-11-06 13:12:17 -08:00
Benjamin Bouvier
b7f2acf0ea [build] Implement registers code generation in the Rust meta crate; 2018-11-06 13:12:17 -08:00
Benjamin Bouvier
4f2d7dd54f [build] Move Isa enum to the meta library; 2018-11-06 13:12:17 -08:00
Benjamin Bouvier
17e88ed1c5 [build] Use the Rust-generated types files in place of the Python one; 2018-11-06 13:12:17 -08:00
Dan Gohman
8d7538049c Pass TargetFrontendConfig by value rather than by reference.
Passing it by reference was an artifact of an earlier version of the
TargetFrontendConfig code, but it's no longer needed, as
TargetFrontendConfig is now a Copy type.
2018-11-06 07:03:04 -08:00
Dan Gohman
3ff8867e57 Split the default edge of a br_table.
When splitting critical edges for a br_table to handle arguments being
passed, split the default edge along with the normal table edges.
2018-11-06 15:53:05 +01:00
Dan Gohman
a5cad9a748 Fix a typo in a comment. 2018-11-02 13:56:38 -07:00
Dan Gohman
d4f8eb7453 Introduce a TargetFrontendConfig type. (#570)
* Introduce a `TargetFrontendConfig` type.

`TargetFrontendConfig` is information specific to the target which is
provided to frontends to allow them to produce Cranelift IR for the
target. Currently this includes the pointer size and the default calling
convention.

The default calling convention is now inferred from the target, rather
than being a setting. cranelift-native is now just a provider of target
information, rather than also being a provider of settings, which gives
it a clearer role.

And instead of having cranelift-frontend routines require the whole
`TargetIsa`, just require the `TargetFrontendConfig`, and add a way to
get the `TargetFrontendConfig` from a `Module`.

Fixes #529.
Fixes #555.
2018-11-02 13:51:42 -07:00
Joe Howarth
7094d9f470 Prefix verifier errors with ; (#585)
* Prefix verifier errors with ;

extract arrow drawing code into helper
print ; at beginning of line followed by arrow and error body
2018-11-02 13:47:39 -07:00
bjorn3
6f8c3012c6 SimpleJit perf map (#571)
* SimpleJit perf map
2018-11-02 12:57:14 -07:00
Dan Gohman
9471c06da4 Update to use newer Rust features.
This re-introduces several cleanups that we previously deferred for not
supporting Rust 1.25.
2018-10-31 12:54:16 -07:00
Dan Gohman
62e55f63e6 Update the minimum supported Rust version to 1.29.
We no longer need the Ubuntu LTS restriction, so now the only only
constraint I'm aware of is Firefox's policy. Fortunately, that tracks
the latest stable delayed by only two weeks. So this puts is at
Rust 1.29 now.
2018-10-31 12:54:16 -07:00
Dan Gohman
5d9591d1ef Adjust whitespace to match the upstream exception text.
This is a whitespace-only change.
2018-10-30 11:28:08 -07:00
Dan Gohman
0b769f5020 Use Display rather than having an explicit name() function for types.
This is more idiomatic Rust.
2018-10-30 11:45:35 +01:00
theJosher
2a5f245b1d #558 undoing the workaround - removing mypy 0.630 pin 2018-10-29 19:53:43 -07:00
theJosher
d2b3ff6183 Errors reported by mypy 0.641 #558 2018-10-29 19:53:43 -07:00
Dan Gohman
f1db50aa76 Fix constant-offset folding to use the correct operand for stores. 2018-10-29 16:18:12 +01:00
Dan Gohman
2de5542139 Make FuncEnvironment::return_mode() default to NormalReturns.
`NormalReturns` is what we expect most users will normally want.
2018-10-29 15:37:08 +01:00
Dan Gieschen Knutson
a19c6088f0 use iterative rather than recursive method for following aliases (#573)
* use iterative rather than recursive method for following aliases

* this avoids consuming stack via plain recursive calls
2018-10-28 20:26:44 -07:00
Dan Gohman
bf569b70dc Make cranelift-wasm's type_to_type easier to optimize. 2018-10-26 11:24:43 -07:00
Dan Gohman
87e683b1f4 Update no_std support. 2018-10-26 11:23:04 -07:00
Dan Gohman
1b21d3a90e Fix the path to cdsl/types.py in a comment. 2018-10-26 11:22:43 -07:00
Aaron Power
e999c53eaa Provide optimised codegen for small libc calls 2018-10-25 07:33:50 -07:00
Dan Gohman
07c98f5330 Fix an unused import warning. 2018-10-24 11:12:24 -07:00
Dan Gohman
a2fcb32245 Escape backslashes in Python comments.
The latest version of flake8 diagnoses these as invalid escape
sequences, so properly escape them.
2018-10-24 10:00:42 -07:00
Dan Gohman
6a234893eb Remove use of deprecated APIs.
std::error::Error's description() function is [deprecated]; follow the
recommended advice and use to_string() instead.

[deprecated]: https://doc.rust-lang.org/std/error/trait.Error.html#method.description
2018-10-23 17:33:20 -07:00
Dan Gohman
ed8ecb99df Remove an obsolete comment. 2018-10-23 16:47:29 -07:00
Boris-Chengbiao Zhou
b288c6001a Fix all clippy warnings (#564)
* Fix all clippy warnings

* Revert usage of inclusive ranges

* Remove redundant function argument

* Revert use of unavailable pointer methods

* Introduce ContiguousCaseRange
2018-10-22 21:52:35 -07:00
Lachlan Sneff
586a8835e9 Add a readonly flag for loads (#562)
* Add readonly MemFlag

* Add readonly flag verifier check

* Make global loads readonly

* Fix gvn to consider readonly loads
2018-10-22 21:50:09 -07:00
Benjamin Bouvier
3ec21459c5 Remove verify! macro that's used only once; 2018-10-19 16:10:05 -07:00
Dan Gohman
fcb1151dd1 Add a badge indicating Rust 1.25 support. 2018-10-19 11:05:35 -07:00
Dan Gohman
8cd1b87917 Rename parse_elements_section.
In WebAssembly documentation, it's the "element" section.
2018-10-19 10:59:32 -07:00
Dan Gohman
54ab1ea533 Optimize load/store with an iadd_imm operand.
Fold the immediate into the load/store offset when possible.
2018-10-19 10:58:55 -07:00
oooooba
709eed21c1 Use types to represent wasm global/table/memory/signature indices (#560)
* Use a type to represent wasm table indices.

* Use a type to represent wasm global variable indices.

* Use a type to represent wasm memory indices.

* Use a type to represent wasm signature indices.

* Use PrimaryMap instead of Vec to protect against using wrong indices.
2018-10-19 10:49:41 -07:00
Dan Gohman
e10a3434b8 Update test files for the cranelift_filetests::run API change. 2018-10-16 10:03:48 -07:00