Commit graph

289 commits

Author SHA1 Message Date
Chris Fallin 6508cc9078 Format. 2023-02-28 16:35:23 -08:00
Chris Fallin 1c0b2964af Tweaks to API around function bodie. 2023-02-28 16:31:53 -08:00
Chris Fallin 2713240bd0 Remove Fuel -- no longer needed 2023-02-28 16:15:44 -08:00
Chris Fallin 610c9710d3 Support expanded but not modified (dirty) functions.
This allows using a function body as a source for a transform without
necessarily requiring a recompilation as well.
2023-02-28 16:11:31 -08:00
Chris Fallin 816ed81ac5 Add new remove_phis pass, and fix empty_blocks. 2023-02-27 23:11:16 -08:00
Chris Fallin 8145c6bca7 Bugfix to localify: properly handle workqueue dedup (actually remove from set when popping from queue) 2023-02-26 00:25:33 -08:00
Chris Fallin ce09169375 bugfixes 2023-02-25 22:52:59 -08:00
Chris Fallin b76e7758b7 WIP. 2023-02-25 17:29:17 -08:00
Chris Fallin f18c624b9a fuzzing: reject too-large memories 2023-02-25 17:12:02 -08:00
Chris Fallin 9c84c7d44d Rewrite localifier (regalloc). 2023-02-25 17:02:14 -08:00
Chris Fallin f81b5bfbe9 Fuel mechanism to help debug opts 2023-02-25 11:31:49 -08:00
Chris Fallin 9031e74abd some tweaks to localify 2023-02-25 11:21:47 -08:00
Chris Fallin 63f5eca6a9 Add SSA validator to end of optimization pipeline. 2023-02-25 10:45:58 -08:00
Chris Fallin 958269be23 add missing fuzzing.rs 2023-02-24 22:07:35 -08:00
Chris Fallin fb719ff0d0 fix opt_diff fuzzbugs 2023-02-24 22:01:33 -08:00
Chris Fallin dc541497b2 fix overflow 2023-02-24 21:54:04 -08:00
Chris Fallin ac2556a7ad Fix opt_diff 2023-02-24 21:52:09 -08:00
Chris Fallin 2ff4d80286 Fuzzer: differential comparison of opt/no-opt 2023-02-24 21:28:40 -08:00
Chris Fallin 055193e926 Add tracing. 2023-02-24 14:40:37 -08:00
Chris Fallin 20ea31c9dd Some refactoring for tracepoints 2023-02-24 12:48:28 -08:00
Chris Fallin 5c48a0a3ea Merge branch 'main' of github.com:cfallin/waffle 2023-02-24 11:36:42 -08:00
Chris Fallin 6dbdefc858 Fix rounding in f32.nearest / f64.nearest 2023-02-24 11:36:38 -08:00
Chris Fallin 8600c1f472 Add some more WASI stubs 2023-02-23 20:53:22 -08:00
Chris Fallin 0f42e16446 Merge branch 'main' of github.com:cfallin/waffle 2023-02-23 20:50:11 -08:00
Chris Fallin 95b04005d4 fix min/max NaN behavior 2023-02-23 20:50:04 -08:00
Chris Fallin 870244f4ce interp: make WASI impl compatible with SpiderMonkey.wasm 2023-02-23 20:37:15 -08:00
Chris Fallin e73ce71519 fix saturating-conversion op bug in const prop 2023-02-23 19:48:09 -08:00
Chris Fallin 7614a382cc fix const_eval for opts 2023-02-23 19:35:45 -08:00
Chris Fallin d6dbc0e830 Fill in some missing FP ops in interpreter 2023-02-23 19:31:51 -08:00
Chris Fallin c01e07977a Separate out barebones WASI impl 2023-02-23 19:20:17 -08:00
Chris Fallin 49a907da25 Working interpreter 2023-02-23 19:16:08 -08:00
Chris Fallin 0d35c06ac6 WIP interpreter. 2023-02-23 18:40:25 -08:00
Chris Fallin de5c990d18 Avoid empty_blocks pass for now; seems problematic. 2023-02-21 22:48:19 -08:00
Chris Fallin 79b4e710c8 Avoid recursion in stackify.
This commit rewrites `stackify` (Ramsey control-flow algorithm) with
explicit-stack control flow, using a state-machine stack, rather than
direct recursion. This avoids stack overflow for large function bodies.
2023-02-21 22:22:14 -08:00
Chris Fallin 0e2e5bf098 Make debuginfo parsing optional. 2023-02-16 16:20:54 -08:00
Philip Craig 5470e80851 DWARF addresses are relative to the start of the code section
This partially reverts the previous commit.

Also fix the logic in `DebugLocReader::get_loc`.
2023-02-15 15:40:27 +10:00
Chris Fallin c999f995be Working debug-locs 2023-02-14 20:38:52 -08:00
Chris Fallin 4bbeb84832 waffle-util: always expand all funcs 2023-02-14 19:24:03 -08:00
Chris Fallin e23d19b03a Remove code_offset; relative to code section? 2023-02-13 18:15:38 -08:00
Chris Fallin df19820693 Show srclocs 2023-02-13 18:10:34 -08:00
Chris Fallin cfc758900d WIP. 2023-02-13 17:42:43 -08:00
Chris Fallin ebfd4209fe WIP. 2023-02-13 17:02:25 -08:00
Chris Fallin b24ca8de43 Merge branch 'addr2line' 2023-02-13 16:17:57 -08:00
Chris Fallin 19392d05b0 Add debug-loc info 2023-02-13 16:17:17 -08:00
Chris Fallin aac46663f0 Sort debuginfo tuples by starting address, and detect overlapping ranges 2023-02-13 14:30:25 -08:00
Chris Fallin 508620289f More descriptive logging to help diagnose irreducible control flow 2023-02-12 17:32:06 -08:00
Chris Fallin ec2a999359 Add block names to irreducible-control-flow error 2023-02-12 13:53:03 -08:00
Chris Fallin f17164f56f Add descriptive-name field to blocks. 2023-02-12 13:50:58 -08:00
Chris Fallin 0e958f5a4b Fix debuginfo parsing: actually supply all needed sections to addr2line. 2023-02-12 11:37:52 -08:00
Chris Fallin 75a6f9a8ce Add missing ir/debug.rs. 2023-02-10 21:04:01 -08:00
Chris Fallin ceaa8acac6 Add addr2line usage to attempt to get source-loc information 2023-02-10 20:55:45 -08:00
Chris Fallin 8d0dc93930 Add support for roundtripping function names. 2023-02-07 18:48:11 -08:00
Chris Fallin 332c0c6f3c Merge branch 'main' of github.com:cfallin/waffle 2023-02-07 17:36:03 -08:00
Chris Fallin 2d7e02deb0 Fix waffle-util build. 2023-02-07 17:31:52 -08:00
Chris Fallin fd748dd493 misc API updates 2023-02-07 15:54:24 -08:00
Chris Fallin eaa1f76ba0 Fix lazy-func expansion error in borrow-avoidance strategy 2023-02-07 14:57:17 -08:00
Chris Fallin 5b4279f517 Lazy function parsing and recompilation when roundtripping 2023-02-07 14:34:59 -08:00
Chris Fallin c908463ee1 Add remove-empty-blocks pass. 2023-02-07 12:44:00 -08:00
Chris Fallin 32a6cd2c00 cargo-fmt. 2023-02-02 20:45:13 -08:00
Chris Fallin b35e0837a4 Refactor Module interface to expose tables directly. 2023-02-02 13:58:50 -08:00
Chris Fallin b6ce3abc1d Add maximal-SSA mode. 2022-12-02 11:58:04 -08:00
Chris Fallin 5bdb4a1737 WIP. 2022-12-01 23:16:21 -08:00
Chris Fallin 4140ed9ea6 WIP. 2022-12-01 20:36:28 -08:00
Chris Fallin 77141d2177 Validator. 2022-12-01 19:56:27 -08:00
Chris Fallin 510f833da2 No RPO pass; put RPO functionality in CFGInfo. 2022-12-01 18:57:00 -08:00
Chris Fallin 7a3e9ce2e3
Fix reachability bug for default target of br_table. 2022-12-01 12:38:48 -08:00
Chris Fallin f83420bbf7
Parallelize with rayon 2022-12-01 10:02:42 -08:00
Chris Fallin ae091d5319
Bugfix: block start point is at start of block, not end. 2022-12-01 00:22:07 -08:00
Chris Fallin 4b40e52c28
Fix regalloc issue 2022-11-30 23:36:00 -08:00
Chris Fallin 284be86cd4
Bugfix in reachability and local resolution 2022-11-30 22:17:28 -08:00
Chris Fallin 84e16a57da
Log which function is being compiled in backend. 2022-11-30 21:11:19 -08:00
Chris Fallin 4c90c8a4a8
regalloc bugfix 2022-11-30 19:02:15 -08:00
Chris Fallin 1788a42aa1
regalloc fix: scan blocks bottom-up, not top-down! 2022-11-30 18:19:48 -08:00
Chris Fallin 38591d90a3
fix regalloc 2022-11-30 17:28:18 -08:00
Chris Fallin 75d4323c4d
Working single-pass regalloc. 2022-11-30 14:25:53 -08:00
Chris Fallin 1862a4c027
Merge branch 'main' of github.com:cfallin/waffle 2022-11-30 00:07:41 -08:00
Chris Fallin 92a7486bf3
regalloc bug: mark locals as used when value already has locals, e.g. for function param 2022-11-30 00:07:32 -08:00
Chris Fallin bc53233e0c rm old binaryen stuff 2022-11-29 22:38:37 -08:00
Chris Fallin 52db5b4a4e
Bugfix 2022-11-29 22:37:35 -08:00
Chris Fallin 50b83525e1
Analogous bugfix at another site. 2022-11-29 22:31:12 -08:00
Chris Fallin 7da027a51d
Bugfix in SSA construction. 2022-11-29 22:28:44 -08:00
Chris Fallin 0966fdf1e8
Reachability bugfix. 2022-11-29 21:39:29 -08:00
Chris Fallin 52013a7f46
Fix subtle interaction of treeifier-induced code motion and local (register) allocation. 2022-11-29 21:04:55 -08:00
Chris Fallin 3d102ac899
Bugfix: drop unused values. 2022-11-29 20:21:51 -08:00
Chris Fallin eafb4dc649
Bugfix: i64.eqz returns i32, not i64, in constprop pass. 2022-11-29 19:54:35 -08:00
Chris Fallin 8caba239fa
WIP. 2022-11-29 19:49:22 -08:00
Chris Fallin 4e3fb51aa9
WIP. 2022-11-29 18:40:57 -08:00
Chris Fallin 5a6177b613
WIP. 2022-11-29 18:03:33 -08:00
Chris Fallin 9ce0d259b4
WIP. 2022-11-29 17:32:38 -08:00
Chris Fallin 5ee73ea177
WIP. 2022-11-29 13:43:13 -08:00
Chris Fallin e5491528af
WIP. 2022-11-29 13:31:23 -08:00
Chris Fallin 232b34f66b
Better unreachability handling. 2022-11-29 13:22:04 -08:00
Chris Fallin 35ecc79136
WIP. 2022-11-29 10:51:50 -08:00
Chris Fallin 349032b1af
WIP. 2022-11-29 10:44:15 -08:00
Chris Fallin a053396e69
WIP. 2022-11-29 10:38:31 -08:00
Chris Fallin 6373cfd665
WIP. 2022-11-29 10:36:45 -08:00
Chris Fallin 6273e399de
WIP. 2022-11-29 10:33:06 -08:00
Chris Fallin 26e7c7a3af
Better error handling in fuzzing; skip on unsupported features 2022-11-29 10:05:43 -08:00
Chris Fallin 61105ea7fc WIP. 2022-11-29 02:45:07 -08:00
Chris Fallin e9d4fe89b1 WIP: almost-complete Wasm backend. 2022-11-29 02:30:37 -08:00