Commit Graph

409 Commits

Author SHA1 Message Date
Dan Gohman
59f6c81e4f Bump version to 0.34.0 2019-07-09 12:31:58 -07:00
Nicolas B. Pierron
3ac7466cab Legalize br_table to a BB-like format. 2019-07-09 16:48:54 +02:00
Nicolas B. Pierron
1963c223b1 Legalize trapz/trapnz to a BB-like format. 2019-07-09 16:02:49 +02:00
Nicolas B. Pierron
f431465802 Replace newly inserted fallthrough by jump. 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
8bfdfbe68b Use BB-like EBB in filetests/regalloc/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
a1a4b9bfb1 Use BB-like EBB in filetests/verifier/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
8c65ec0dde Use BB-like EBB in filetests/regress/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
3c6ca9049e Use BB-like EBB in filetests/simple_gvn/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
560619f749 Use BB-like EBB in filetests/cfg/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
3970fa2752 Use BB-like EBB in filetests/postopt/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
4316917cb9 Use BB-like EBB in filetests/parser/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
7b36cb58a0 Use BB-like EBB in filetests/isa/x86/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
77eb34e20f Use BB-like EBB in filetests/isa/riscv/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
40eede927b Use BB-like EBB in filetests/domtree/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
44abcbec1e Use BB-like EBB in filetests/licm/*.clif 2019-07-08 15:17:49 +02:00
Dan Gohman
a3e459269e Bump version to 0.33.0 2019-07-03 10:40:58 -07:00
Dan Gohman
b35227b417 Bump version to 0.32.0 2019-07-02 12:27:39 -07:00
Dan Gohman
4b924d34b6 Bump version to 0.31.0 2019-06-28 11:37:39 -07:00
Benjamin Bouvier
83336290c2 Mark the jump_table_entry Instruction as loading; 2019-06-27 17:38:20 +02:00
Benjamin Bouvier
d7d48d5cc6 Add the dyn keyword before trait objects; 2019-06-24 11:42:26 +02:00
julian-seward1
5fb347b7bc Merge pull request #784 from julian-seward1/issue779
Only create copy_nop instructions for types for which an encoding exi…
2019-06-05 15:05:56 +02:00
Julian Seward
b1488decc4 Only create copy_nop instructions for types for which an encoding exists. Issue #779.
PR #773 detects, at reload time, `copy` instructions that copy a value from stack
slot back to the same stack slot.  It replaces them with `copy_nop` instructions
that have a null encoding (hence producing no code).

For x86_64, `copy_nop` encodings for the types I64, I32, F64 and F32 are
provided.  Unfortunately the code that detects the redundant copy doesn't
check the type of the copied value, hence leaving itself open to the danger of
creating a `copy_nop` instruction cannot be encoded (which is different from
saying it has a null encoding).

This patch:

* Expands the x86_64 set of `copy_nop` encodings to: I64 I32 I16 I8 F64 and F32

* Adds encodings for the same for x86_32, rv64 and rv32.

* In `visit_inst()` in `reload.rs`, checks the type of the copied value accordingly.

* Adds comments explaining the above.
2019-06-05 13:06:22 +02:00
Lars T Hansen
420850adf0 Record information about sections of emitted code+data.
The result of the emitter is a vector of bytes holding machine code,
jump tables, and (in the future) other read-only data.  Some clients,
notably Firefox's Wasm compiler, needs to separate the machine code
from the data in order to insert more code directly after the code
generated by Cranelift.

To make such separation possible, we record more information about the
emitted bytes: the sizes of each of the sections of code, jump tables,
and read-only data, as well as the locations within the code that
reference (PC-relatively) the jump tables and read-only data.
2019-05-31 08:39:57 +02:00
iximeow
6059936113 remove rex-prefixed recipes for e9 and eb jumps
while not incorrect, the prefix has no additional semantics on these
  instructions other than taking an extra byte for the jump
2019-05-29 11:32:44 +02:00
Nicolas B. Pierron
72b5487563 Add x86 encoding for rotr_imm and rotl_imm. 2019-05-20 11:56:56 +02:00
bjorn3
71a345e813 Legalize fcvt_from_u/sint.f32/f64.i8/i16 2019-05-20 11:52:43 +02:00
Antoni Boucher
d8d573208b Remove unwrap() for branch folding 2019-04-28 16:32:01 -07:00
Antoni Boucher
4ee2747c5b Fix cranelift_preopt panic
Fix #611
2019-04-28 16:32:01 -07:00
Benjamin Bouvier
95e6fc9efc Avoid inserting checks during div/rem legalization when the input is a constant immediate; 2019-04-25 16:58:41 +02:00
Benjamin Bouvier
274415d5ee Fixes #738: Check ebbs used in jump tables in the verifier; 2019-04-17 15:37:27 +02:00
Tyler McMullen
1090dc5069 Switch from fallthrough back to jump. 2019-04-17 13:15:41 +02:00
Tyler McMullen
5596b5fadc Address code review comments, simplifying some bits of branch_opt. 2019-04-17 13:15:41 +02:00
Tyler McMullen
fd6940baaf Switch branch order opt from brif/brff to br_icmp, as that's what frontends should produce. 2019-04-17 13:15:41 +02:00
Tyler McMullen
571b87414f Switch ifcmp+brif folding to be icmp+brz folding, which is what frontends actually produce. 2019-04-17 13:15:41 +02:00
Tyler McMullen
861ef3a2e5 Questionable change: Remove domtree generation from simple_preopt testing. 2019-04-17 13:15:41 +02:00
Tyler McMullen
89a2dd9414 Add tests for branch order and branch comparison folding. 2019-04-17 13:15:41 +02:00
Tyler McMullen
fc6876c68e Fold 'ifcmp_imm' + 'brif' where imm is zero and cond is 'eq' or 'ne', into 'brz' or 'brnz'. 2019-04-17 13:15:41 +02:00
Lars T Hansen
aa926e9097 Allow readonly nontrapping loads to be hoisted by licm (#727) 2019-04-09 11:40:23 +02:00
Philip Craig
b74b49f7c6 Fix x86-64 encoding of uextend.i64.i8
The non-REX encoding of movzbl requires one of the ABCD registers as input.
2019-04-08 05:50:59 -07:00
Benjamin Bouvier
cd8a42e01f Fix #686: Allow code shrink in relaxation if the shrinking pass hasn't been run;
Also:
- make sure to apply diversions when determining offsets for code
relaxation.
- select the smallest encoding when selecting a relaxed branch
instruction.
2019-04-03 11:42:38 +02:00
Dan Gohman
ec0b10cd34 Bump version to 0.30.0 2019-03-26 09:36:22 -07:00
Steffen Butzer
92b3987e54 windows/x64 call convention: only use XMM0 for float return values (#691) 2019-03-11 11:44:44 +01:00
Dan Gohman
34aba7fe66 Bump version to 0.29.0 2019-03-05 06:36:34 -08:00
Steffen Butzer
2a519092a0 Use single index for param register allocation for windows callconv (… (#693)
* Use single index for param register allocation for windows callconv (#691)

The used registers depend entirely on the parameter index (1st, 2nd, 3rd, 4th, ... param)
and we cannot shift unused registers to other indexes, if they are not designated for
the use for that parameter index.
2019-03-05 12:17:41 +01:00
robojumper
851f125eda Fix bitrev intrinsic 2019-02-22 16:55:15 -08:00
Benjamin Bouvier
a45b814de8 Fixes #13: Enable conditional compilation of ISAs through features; 2019-02-12 08:19:57 -08:00
Benjamin Bouvier
afa4a749c5 Fix #666: Change the way we consider a block has been visited in relaxation;
This was previously using the following condition to decide that a block
hadn't been visited yet: either dest_offset is non-0 or the block isn't
the entry block. Unfortunately, this didn't work when the first block
would be non-empty but wouldn't generate code at all.

Since the original code would do at least one pass over the entire code,
the first pass that determines initial EBB offsets is done separately,
without considering branch relaxation. This ensures that all EBBs have
been visited and have correct initial offsets, and doesn't require a
special check to know whether an EBB has been visited or not.
2019-02-12 14:39:45 +01:00
lazypassion
747ad3c4c5 moved crates in lib/ to src/, renamed crates, modified some files' text (#660)
moved crates in lib/ to src/, renamed crates, modified some files' text (#660)
2019-01-28 15:56:54 -08:00
Dan Gohman
6326140227 Fix legalization of bxor_imm. 2019-01-22 23:45:23 -08:00
Bruce Mitchener
4f8753fa11 Fix typos. 2018-12-24 10:03:22 -08:00