Benjamin Bouvier
036b9aea94
[codegen] Rename and explicit usage of replace_with_alias;
...
It can actually only replace one result; don't try to make it generic
yet, since there's no point in doing so right now, and make it do the
dumb thing so it's not surprising to use.
2019-08-20 19:06:09 +02:00
Benjamin Bouvier
b659262d2a
Use aliasing instead of copying in simple_preopt;
2019-08-16 10:41:51 -07:00
iximeow
6e57e3f8f3
preopt: use replaced arg after having replaced BinaryImm
...
when replacing BinaryImm, we use the prior arg, but later use the arg
that was replaced when writing an alias if we can determine the new op
is actually equivalent to a simple copy
2019-08-01 11:00:37 +02:00
Benjamin Bouvier
057d4f6e3c
Simple preopt: Fold (imm OP x) into (OP_IMM x imm) whenever possible;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
23ac723d4c
Simple preopt: fold instructions using simple algebraic identities;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
2fef2eef67
Simple preopt: try to fold right-shift of left-shift into an extended move;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
141b45e0e1
Simple preopt: fold binary opcodes chains together;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
dc58a5fc5c
Simple preopt: use the immediate form for adjust_sp_down/ifcmp whenever possible;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
6acf9be540
Refactor simple-preopt to make it slightly simpler to read;
...
- don't use camel case but snake casing;
- longer variable names;
- more whitespace;
- add/wrap comments;
2019-04-24 14:14:44 +02:00
Tyler McMullen
3b1583ebb7
Style changes in response to code review.
2019-04-17 13:15:41 +02:00
Tyler McMullen
4d427d7c71
Remove old commented out code
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
402d0d9c83
Add comments to branch folding and reordering functions in simple_preopt.
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
67cc5aafec
Refactoring of branch ordering and zero-check optimization based on PR feedback.
2019-04-17 13:15:41 +02:00
Tyler McMullen
947130be81
Add branch order optimization to simple_preopt to encourage fallthroughs.
2019-04-17 13:15:41 +02:00
Tyler McMullen
57f087c9da
Add note to simple_preopt differentiating its use from the preopt crate.
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
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