Commit Graph

296 Commits

Author SHA1 Message Date
Muhammad Mominul Huque
effe6c04e4 Update to Rust 2018 edition (#632)
* initial cargo fix run

* Upgrade cranelift-entity crate

* Upgrade bforest crate

* Upgrade the codegen crate

* Upgrade the faerie crate

* Upgrade the filetests crate

* Upgrade the codegen-meta crate

* Upgrade the frontend crate

* Upgrade the cranelift-module crate

* Upgrade the cranelift-native crate

* Upgrade the cranelift-preopt crate

* Upgrade the cranelift-reader crate

* Upgrade the cranelift-serde crate

* Upgrade the cranelift-simplejit crate

* Upgrade the cranelift or cranelift-umbrella crate

* Upgrade the cranelift-wasm crate

* Upgrade cranelift-tools crate

* Use new import style on remaining files

* run format-all.sh

* run test-all.sh, update Readme and travis ci configuration
fixed an AssertionError also

* Remove deprecated functions
2018-12-26 09:49:05 -08:00
bjorn3
e3db942b0c Put default implementations of FuncWriter methods in a seperate method
This is useful when you want to write extra information
2018-12-26 09:21:32 -08:00
Bruce Mitchener
4f8753fa11 Fix typos. 2018-12-24 10:03:22 -08:00
Nicholas Nethercote
46d9a3cd1a Use an FxHashMap in RegDiversions.
Because it's hot and the number of entries can reach the 1000s, so
linear insertion and search is bad.

This reduces runtime for `sqlite` and `UE4Game-HTML5-Shipping` by 3-4%,
and a couple of other benchmarks (`sqlite`, `godot`, `clang`) by smaller
amounts.

It also increases runtime for `mono` and `tanks` by about 1%; this seems
to be due to incidental changes in which functions are inlined more than
algorithmic changes.
2018-12-17 21:36:06 -08:00
Dan Gohman
8bd35e154b Tidy up some match bindings to be more consistent with the rest of the codebase. 2018-12-11 13:22:28 -08:00
Dan Gohman
c8e457e834 Bump version to 0.26.0 2018-12-11 12:54:23 -08:00
Dan Gohman
bc18085ad1 Use EntityRef::from_u32 to reduce casting. 2018-12-11 15:40:24 -05:00
Dan Gohman
a55c933f19 Factor out a MemFlags constructor for trusted notrap/aligned accesses. 2018-12-11 15:40:24 -05:00
Dan Gohman
566c160c37 Add a function to return the pointer type for a given triple.
Also use a slightly tidier naming convention for such functions.
2018-12-11 15:40:24 -05:00
Dan Gohman
91477d21c8 Add an as_u32() member to entity_impl types.
This allows us to avoid a lot of casting indices back to u32.
2018-12-11 15:40:24 -05:00
Dan Gohman
a20c852148 Support heaps with no offset-guard pages.
Also, say "guard-offset pages" rather than just "guard pages" to describe the
region of a heap which is never accessible and which exists to support
optimizations for heap accesses with offsets.

And, introduce a `Uimm64` immediate type, and make all heap fields use
`Uimm64` instead of `Imm64` since they really are unsigned.
2018-12-11 15:40:24 -05:00
Benjamin Bouvier
93696a80bb Fixes #614: Implement a debug trap; 2018-12-10 14:14:04 -05:00
Dan Gohman
5d7ece3d15 Fix clippy warning namespaces. 2018-12-06 20:50:38 -05:00
Dan Gohman
5adab629f2 Update to the rustfmt in rust 1.31, which is now stable. 2018-12-06 16:15:48 -05:00
Benjamin Bouvier
d94e027c2a [build] Move settings generation from Python to Rust code; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
4c8f1e7a5a [meta] Ignore empty lines to compute indent when parsing multiple lines; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
12df943409 [meta] Add support to generate Match expressions in Rust; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
d15e56a9fa Add build warning only if CRANELIFT_VERBOSE is set to anything; 2018-11-30 11:05:21 -06:00
Dan Gohman
9947c315b7 Fix Python check script to work outside of Travis. 2018-11-30 06:07:18 -08:00
Dan Gohman
ba48fd2223 Add TODO comments noting temporary bug workarounds. 2018-11-28 17:18:12 -08:00
Dan Gohman
06d269be63 Disable mypy on OSX on Travis. 2018-11-28 16:36:59 -08:00
Dan Gohman
30654a6a7d Bump version to 0.25.0 2018-11-26 22:31:07 -08:00
Dan Gohman
c17579e7ec Bump version to 0.24.0 2018-11-26 22:18:36 -08:00
Dan Gohman
54c388d870 Make the verifier output even prettier (#599)
* Fix verifier printing to print instruction encodings consistently.

Use `FuncWriter::write_instruction` for all instructions so that
encodings are printed consistently.

* Make use-before-def errors mention the relevant value.

* When there are verifier errors, print a message at the end.

* Make verifier errors prettier.

Fix the length of the "^~~~~" to match the printed entity, and print the
error messsage on its own line.

* Clean up "test verifier" failure messages.

* Tidy the uses-value-from-itself error.

The use instruction is the same as the def instruction, so don't print
both. Also, the use instruction is already being printed at the
beginning, so don't print it again at the end.
2018-11-26 22:18:18 -08:00
Syrus Akbary
48186b3199 Make TargetIsa thread-safe 2018-11-20 22:15:40 -06:00
Dan Gohman
0fed78e063 Don't allow loop preheaders to have critical edges.
If the block which would be a preheader for a loop has other successors,
don't hoist instructions into it. Instead create a dedicated preheader.
2018-11-16 10:27:24 +01:00
Dan Gohman
641771ac6a Add encodings to the instructions in LICM's generated preheaders.
When LICM generates a preheader, it needs to add encodings to the
instructions it generates, since it runs after legalization.
2018-11-16 10:27:24 +01:00
Benjamin Bouvier
b41bc55007 Pretty-print errors for extended basic blocks too; 2018-11-14 13:08:54 -08:00
Benjamin Bouvier
d45e8b5830 Add SIB/offset for ABCD stores too; 2018-11-14 13:08:54 -08:00
Benjamin Bouvier
b170b74b65 Fixes #600: Add a SIB byte when encoding a non-indexed load/store into r12/rsp;
Memory access instructions which took the GPR_ZERO_DEREF_SAFE register
class (that was removed in #600) should check for the need of either an
offset (r13/rbp) or the SIB byte (r12/rsp). Some load/store instructions
would already take an index, thus already contain the SIB byte in this
case (see instructions which have a comment telling that the else branch
already contains an SIB byte). Non-indexed memory accesses lacked the
SIB byte check, which this patch adds.
2018-11-14 13:08:54 -08:00
Dan Gohman
f6617afcdd Remove the build time and directory from cranelift-codegen-meta's output.
This makes its output nondeterministic, making it friendier for
compilation caching tools.
2018-11-14 13:03:00 -08:00
oooooba
155fd4c72a Eliminate call stack recursion in VirtRegs::find (#584)
* Eliminate call stack recursion in VirtRegs::find
2018-11-14 12:58:50 -08:00
Dan Gohman
c2f5bc00a5 Fix typos in comments. 2018-11-12 15:15:02 -08:00
Dan Gohman
cd7c57e598 Make spilling visit fallthrough_return instructions too.
This is a followup to af2a952aabd82cf401cc664d0262b139ff92d86b. It
teaches the spilling pass to use the is_ghost() property to test whether
to visit instructions. This fixes a bug handling multiple return values
with fallthrough_return.
2018-11-12 19:43:55 +01:00
Dan Gohman
f3ea2d5d66 Tidy up documentation comment syntax. 2018-11-12 06:38:50 -08:00
Dan Gohman
076850549d Clarify an assertion error message. 2018-11-12 06:38:46 -08:00
Dan Gohman
7b27fdbf54 Avoid cloning an InstructionData when it isn't needed. 2018-11-09 15:13:42 -08:00
Dan Gohman
a0c2b40c17 Remove unnecessary pub keywords. 2018-11-09 15:11:03 -08:00
Dan Gohman
d54569cbdd Fix a typo in a comment. 2018-11-09 15:10:17 -08:00
Benjamin Bouvier
ce2364ddd9 [build] Remove dead code in Python and move assertions to the Rust code generator; 2018-11-09 09:23:36 -08:00
Benjamin Bouvier
add4043bb5 [build] Introduce a TargetIsaBuilder to better encapsulate the TargetIsa;
It was the caller's responsibility to call TargetIsa::check() before;
now one can't manipulate a TargetIsa without calling the
TargetIsaBuilder::finish() method, which is less error-prone and more in
line with what's coming for other things we're going to generate in the
meta crate.

Also splits the construction of a RegClass in two parts: a prototype is
made first when declaring the RegClass, and missing bits are filled in
when adding it to the TargetIsa(Builder). This avoids an awkward passing
of the isa to the RegClass ctor.
2018-11-09 09:23:36 -08:00
Benjamin Bouvier
f896bfb946 Prefix fixed_results/fixed_value_arguments with num to indicate they return a usize; 2018-11-08 11:41:04 -08:00
Dan Gohman
1d14f5ddbd Use cranelift-entity with default features.
The meta crate doesn't need to support no_std, so it can just use
default settings.
2018-11-07 16:24:19 -08:00
Dan Gohman
14dfc0d1b6 Bump version to 0.23.0. 2018-11-07 16:18:04 -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
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