summaryrefslogtreecommitdiff
path: root/src/passes/pass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Validate finalization (#1014)Alon Zakai2017-05-181-6/+7
| | | | | | | * validate that types are properly finalized, when in pass-debug mode (BINARYEN_PASS_DEBUG env var): check after each pass is run that the type of each node is equal to the proper type (when finalizing it, i.e., fully recomputing the type). * fix many fuzz bugs found by that. * in particular, fix dce bugs with type changes not being fully updated during code removal. add a new TypeUpdater helper class that lets a pass update types efficiently, by the helper tracking deps between blocks and branches etc., and updating/propagating type changes only as necessary.
* Re-reloop pass (#1009)Alon Zakai2017-05-161-11/+4
| | | | | 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).
* merge blocks before and after remove-unused-brsAlon Zakai (kripken)2017-05-101-1/+2
|
* Flatten control flow pass (#999)Alon Zakai2017-05-101-0/+1
| | | | | | | | | | | This pass flattens out control flow in order to achieve 2 properties: * Control flow structures (block, loop, if) and control flow operations (br, br_if, br_table, return, unreachable) may only be block children, a loop body, or an if-true or if-false. (I.e., they cannot be nested inside an i32.add, a drop, a call, an if-condition, etc.) * Disallow block, loop, and if return values, i.e., do not use control flow to pass around values. As a result, expressions cannot contain control flow, and overall control flow is simpler, more structured, and more "flat". This should make things like re-relooping wasm code much easier, as they can run after the cfg is flattened
* Add pass to instrument loads / stores. (#959)Michael Bebenita2017-04-291-0/+1
| | | | | | | | * Add pass to instrument loads / stores * Simplify instrumentation. * Document.
* Preserve debug info through the optimizer (#981)Alon Zakai2017-04-281-1/+21
| | | | | | | | | | | | | | * add debugInfo option to passes, and use it to keep debug info alive through optimizations when we need it * add fib testcase for debug info * when preserving debug info, do not move code around call-imports, so debug info intrinsics remain stationary * improve wasm-module-building handling of the single-threaded case: don't create workers, which is more efficient and also nicer for debugging * process debug info in a more precise way, reordering it from being after the node (as it was a comment in JS) to before the node * remove unreachable hack for debug info, which is no longer needed since we reorder them, and make sure to finalize blocks in which we reorder
* add a pass to log execution traces via instrumenting the code (#950)Alon Zakai2017-03-161-0/+1
|
* Local CSE (#930)Alon Zakai2017-03-081-0/+5
| | | Simple local common subexpression elimination. Useful mostly to reduce code size (as VMs do GVN etc.). Enabled by default in -Oz.
* fix BINARYEN_PASS_DEBUG option (#908)Alon Zakai2017-02-231-5/+9
| | | | | * fix BINARYEN_PASS_DEBUG option * Add isNested property to passRunner
* finish PickLoadSigns passAlon Zakai2017-02-161-0/+3
|
* refactor sign/zero extension code into nice headers, and prepare ↵Alon Zakai2017-02-161-0/+1
| | | | PickLoadSigns pass
* add a RemoveUnusedModuleElements pass, and make LegalizeJSInterface create ↵Alon Zakai2016-12-071-3/+3
| | | | TempRet0 if needed (otherwise we might remove it before we use it)
* improve local simplication: simplify without if/block structure values ↵Alon Zakai2016-11-061-1/+2
| | | | before coalesce, so that coalesce can remove all copies, then do another pass of full simplification after it
* add variants of simplify-locals with and without teeing and structural optsAlon Zakai2016-11-051-0/+3
|
* remove-unused-brs after coalesce-localsAlon Zakai2016-11-041-1/+2
|
* add a pass to optimize memory segments, and pack memory in asm2wasmAlon Zakai2016-11-011-0/+3
|
* add an inlining pass (#814)Alon Zakai2016-10-291-0/+1
|
* Code pushing (#807)Alon Zakai2016-10-261-0/+4
| | | Push code forward, potentially letting it not execute
* Adds a pass to print call graphs in .dot (graphviz) format. (#794)Michael Bebenita2016-10-201-0/+1
|
* Pass options (#788)Alon Zakai2016-10-181-4/+4
| | | | * add PassOptions structure, and use it for new -Os param to wasm-opt
* Use steady_clock to measure code execution time (#776)Loo Rong Jie2016-10-171-3/+2
|
* reorder locals after simplify-locals, to remove unused locals before ↵Alon Zakai2016-10-161-0/+1
| | | | coalesce-locals, making it much faster (#783)
* run remove-unused-functions by defaultAlon Zakai2016-10-141-0/+2
|
* reuse code in add*PassesAlon Zakai2016-10-141-15/+1
|
* put heavy pass debugging operations behind BINARYEN_PASS_DEBUG (#755)Alon Zakai2016-10-111-2/+9
|
* passRunner debug and validation improvements (#726)Alon Zakai2016-10-021-6/+17
|
* asm2wasm i64 support (#723)Alon Zakai2016-09-301-0/+1
| | | | | | | | | | | | * support i64 intrinsics from fastcomp, adding --wasm-only flag * refactor callImport logic in asm2wasm to avoid recomputing wasm types again * legalize illegal i64 params in exports and imports * do safe i64 binary ops depending on precision * fix addVar, only assert on names if we are using a name
* add ExtractFunction passAlon Zakai2016-09-131-0/+1
|
* thread relooper jumpsAlon Zakai2016-09-121-0/+1
|
* refactor pass hooks, creating a proper way to run code before a pass is runAlon Zakai2016-09-121-0/+5
|
* validate in debug mode in passRunnerAlon Zakai2016-09-111-5/+14
|
* autodrop must be run before we optimize in asm2wasm, as otherwise its input ↵Alon Zakai2016-09-071-0/+3
| | | | | | is not yet valid then after finalizeCalls, we must autodrop again to drop things that finalizeCalls changed
* remove lower-if-else, as it's no longer neededAlon Zakai2016-09-071-1/+0
|
* remove drop-return-values passAlon Zakai2016-09-071-1/+0
|
* make sure to create instances of function-parallel functions, even in debug modeAlon Zakai2016-07-161-1/+8
|
* Merge pull request #593 from WebAssembly/remove-div0Alon Zakai2016-06-211-5/+37
|\ | | | | Explicit registering of passes
| * Add initialization functions for passes to avoid missing pass registration ↵Jukka Jylänki2016-06-211-5/+37
| | | | | | | | due to linker dead code elimination. Fixes #577.
* | Build fixes/workarounds to support Visual Studio 2013 build, which has ↵juj2016-06-211-1/+1
|/ | | | trouble with some new C++11 constructs. (#581)
* run precompute after every optimize-instructionsAlon Zakai2016-06-181-0/+2
|
* add a precompute passAlon Zakai2016-06-181-0/+2
|
* run remove-unused-brs after simplify-localsAlon Zakai2016-06-111-0/+2
|
* move function parallelism to pass and pass runner, which allows more ↵Alon Zakai2016-06-031-29/+62
| | | | efficient parallel execution (#564)
* add an option to run passes on individual functions, and to get default ↵Alon Zakai2016-06-021-0/+25
| | | | optimization passes suitable for that, or not. refactor visitFunction/Module for this.
* add a pass that eliminates duplicate functionsAlon Zakai2016-05-281-0/+2
|
* dead code elimination pass (#536)Alon Zakai2016-05-221-0/+1
|
* vacuum after passes that create garbage; this makes the total time betterAlon Zakai2016-05-191-1/+3
|
* run merge-blocks after vacuumAlon Zakai2016-05-161-1/+1
|
* add cfg-building traversal and a pass to coalesce locals using itAlon Zakai2016-05-151-0/+1
|
* Use more static libraries in the CMake build (#451)Derek Schuff2016-05-071-0/+126
* Factor passes and emscripten-optimizer into static libs This removes the redundancies from the source sets in the main CMakeLists.txt. * Make passes an object lib * Use static libs with --whole-archive because Travis has old cmake