summaryrefslogtreecommitdiff
path: root/src/passes/ReReloop.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Enforce use of `Type::` on type names (#2434)Thomas Lively2020-01-071-2/+2
|
* Remove FunctionType (#2510)Thomas Lively2019-12-111-2/+3
| | | | | | | | | | | | | | | | | Function signatures were previously redundantly stored on Function objects as well as on FunctionType objects. These two signature representations had to always be kept in sync, which was error-prone and needlessly complex. This PR takes advantage of the new ability of Type to represent multiple value types by consolidating function signatures as a pair of Types (params and results) stored on the Function object. Since there are no longer module-global named function types, significant changes had to be made to the printing and emitting of function types, as well as their parsing and manipulation in various passes. The C and JS APIs and their tests also had to be updated to remove named function types.
* Add string parameter to WASM_UNREACHABLE (#2499)Sam Clegg2019-12-051-2/+2
| | | | | This works more like llvm's unreachable handler in that is preserves information even in release builds.
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-1/+2
| | | Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
* Apply format changes from #2048 (#2059)Alon Zakai2019-04-261-51/+45
| | | Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
* Verify flat IR where it is expected, and give a nice error (#2009)Alon Zakai2019-04-161-0/+3
| | | Fixes #2007 #2008
* Relooper CFG optimizations (#1759)Alon Zakai2018-11-211-6/+7
| | | | | | | | | | | | | | | | Previously the relooper would do some optimizations when deciding when to use an if vs a switch, how to group blocks, etc. This PR adds an additional pre-optimization phase with some basic but useful simplify-cfg style passes, * Skip empty blocks when they have just one exit. * Merge exiting branches when they are equivalent. * Canonicalize block contents to make such comparisons more useful. * Turn a trivial one-target switch into a simple branch. This can help in noticeable ways when running the rereloop pass, e.g. on LLVM wasm backend output. Also: * Binaryen C API changes to the relooper, which now gets a Module for its constructor. It needs it for the optimizations, as it may construct new nodes. * Many relooper-fuzzer improvements. * Clean up HashType usage.
* runFunction => runOnFunction (we run on the function, not run the function) ↵Alon Zakai2018-01-101-1/+1
| | | | (#1356)
* Rereloop fuzz fix (#1259)Alon Zakai2017-11-091-0/+12
| | | | * fix relooper bug, ensure function body has right type, as relooper output does not flow stuff out, but wasm functions with a result do expect a flow value, so none is not an option. in other words, as the docs say, a relooper block must end with a terminator (return, unreachable, break, etc.) and not flow out.
* notation change: AST => IR (#1245)Alon Zakai2017-10-241-1/+1
| | | The IR is indeed a tree, but not an "abstract syntax tree" since there is no language for which it is the syntax (except in the most trivial and meaningless sense).
* fix re-reloop fuzz bug, we need to ensure a terminator in all relooper ↵Alon Zakai2017-10-111-0/+31
| | | | blocks (#1214)
* Flattening rewrite (#1201)Alon Zakai2017-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | Rename flatten-control-flow to flatten, which now flattens everything, not just control flow, so e.g. (i32.add (call $x) (call $y) ) ==> (block (set_local $temp_x (call $x)) (set_local $temp_y (call $y)) (i32.add (get_local $x) (get_local $y) ) ) This uses more locals than before, but is much simpler and avoids a bunch of corner cases and fuzz bugs the old one hit. We can optimize later if necessary.
* Make several derived classes final (#1180)Derek Schuff2017-09-121-6/+5
| | | | | | | Recent versions of clang turn on -Wdelete-non-virtual-dtor at our warning level, which fires when deleting a non-final class that has virtual functions but a non-virtual destructor. Pre-C++11 standard rule of thumb is to just always have a virtual destructor if there are virtual functions, but C++11 final is even better since it may allow for devirtualization optimizations.
* relooper improvementsAlon Zakai (kripken)2017-05-201-0/+3
|
* Re-reloop pass (#1009)Alon Zakai2017-05-161-0/+325
This adds a pass that converts to a CFG, runs the relooper, and re-generates wasm from that. This depends on flatten-control-flow being run before. The main goal here is to help code generators other than asm2wasm (which already receives relooped code from fastcomp).