summaryrefslogtreecommitdiff
path: root/src/passes/SimplifyLocals.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a superclass typedef to WalkerPass to simplify overrides (#1211)jgravelle-google2017-10-041-2/+2
|
* clean up untaken => unreachable, as well as unnecessary named stuff in ↵Alon Zakai2017-09-061-1/+1
| | | | validation that was from when we differentiated reachable from unreachable breaks (#1166)
* Return to more structured type rules for block and if (#1148)Alon Zakai2017-09-051-2/+3
| | | | | | | | * if a block has a concrete final element (or a break with a value), then even if it has an unreachable child, keep it with that concrete type. this means we no longe allow the silly case of a block with an unreachable in the middle and a concrete as the final element while the block is unreachable - after this change, the block would have the type of the final element * if an if has a concrete element in one arm, make it have that type as a result, even if the if condition is unreachable, to parallel block * make type rules for brs and switches simpler, ignore whether they are reachable or not. whether they are dead code should not affect how they influence other types in our IR.
* add the option to seek named breaks, not just taken breaks; refactor headers ↵Alon Zakai (kripken)2017-07-111-1/+1
| | | | to make this practical
* finalize new drops in SimplifyLocalsAlon Zakai (kripken)2017-07-111-0/+2
|
* Validate finalization (#1014)Alon Zakai2017-05-181-0/+1
| | | | | | | * 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.
* Default Walker subclasses to using Visitor<SubType> (#921)jgravelle-google2017-02-231-4/+4
| | | | Most module walkers use PostWalker<T, Visitor<T>>, let that pattern be expressed as simply PostWalker<T>
* Improve handling of implicit traps (#898)Alon Zakai2017-02-061-6/+4
| | | | | | | | * add --ignore-implicit-traps option, and by default do not ignore them, to properly preserve semantics * implicit traps can be reordered, but are side effects and should not be removed * add testing for --ignore-implicit-traps
* improve local simplication: simplify without if/block structure values ↵Alon Zakai2016-11-061-6/+9
| | | | 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-11/+43
|
* refactor get_local counting out of simplify-locals (#812)Alon Zakai2016-10-281-19/+7
|
* when simplify-locals give br_if a value, the br_if also returns it, so it ↵Alon Zakai2016-10-131-4/+8
| | | | must be dropped
* fix a simplify-locals bug where we didn't notice and if already had a result ↵Alon Zakai2016-09-231-3/+2
| | | | value
* when optimizing a block return value, replacing the sunk set with the value ↵Alon Zakai2016-09-141-5/+14
| | | | is only possible if the break is unconditional; if it is condition, we must tee the value so that if the break condition is false and we do not jump, then we have the new value in the local on the line after it
* do a first pass in SimplifyLocals that focuses on single-use localsAlon Zakai2016-09-071-12/+36
|
* add drop and tee expressionsAlon Zakai2016-09-071-12/+30
|
* Add initialization functions for passes to avoid missing pass registration ↵Jukka Jylänki2016-06-211-1/+3
| | | | due to linker dead code elimination. Fixes #577.
* move function parallelism to pass and pass runner, which allows more ↵Alon Zakai2016-06-031-3/+5
| | | | efficient parallel execution (#564)
* refactor walk logic into walk* and doWalk* methods, for a more regular API ↵Alon Zakai2016-05-301-5/+5
| | | | that is clearer where it should be overridden (#551)
* vacuum away everything not tied downAlon Zakai2016-05-191-2/+1
|
* clear sinkables on unoptimizable blocks, as they have a control flow mergeAlon Zakai2016-05-051-6/+10
|
* note defaults of switches in SimplifyLocalsAlon Zakai2016-05-051-0/+1
|
* optimize block and if returns, by merging set_locals that flow out of themAlon Zakai2016-04-241-72/+300
|
* handle dead stores in SimplifyLocalsAlon Zakai2016-04-181-2/+3
|
* remove old comments in SimplifyLocalsAlon Zakai2016-04-181-2/+1
|
* create a UnifiedExpressionVisitor for passes that want a single visitor ↵Alon Zakai2016-04-181-3/+3
| | | | function, to avoid confusion with having both visit* and visitExpression in a single pass (#357)
* use a vector for get_local counts in SimplifyLocals (#356)Alon Zakai2016-04-181-1/+2
|
* index locals, so that get_local and set_local have just an index, and local ↵Alon Zakai2016-04-181-13/+13
| | | | names are kept on the Function object (#354)
* Function parallelism (#343)Alon Zakai2016-04-151-2/+5
| | | | * allow traversals to mark themselves as function-parallel, in which case we run them using a thread pool. also mark some thread-safety risks (interned strings, arena allocators) with assertions they modify only on the main thread
* drop completely unused locals in ReorderLocalsAlon Zakai2016-04-111-0/+4
|
* continue simplifying locals while opportunities present themselvesAlon Zakai2016-04-111-23/+37
|
* dyn_cast => dynCastAlon Zakai2016-04-111-1/+1
|
* remove set_locals with no remaining gets in SimplifyLocalsAlon Zakai2016-04-111-4/+51
|
* De-recurse traversals (#333)Alon Zakai2016-04-111-31/+41
| | | | | | | | | | | | * refactor core walking to not recurse * add a simplify-locals test * reuse parent's non-branchey scan logic in SimpleExecutionWalker, reduce code duplication * update wasm.js * rename things following comments
* add missing checks on nested blocks in SimplifyExpressionsAlon Zakai2016-04-071-2/+7
|
* refactor checks in SimplifyLocalsAlon Zakai2016-04-071-8/+15
|
* handle loops in effect analyzerAlon Zakai2016-04-071-8/+19
|
* fix invalidation logic in SimplifyLocals, visit each node as we hit it, do ↵Alon Zakai2016-04-071-1/+3
| | | | not walk it to look for invalidating elements that are children, we already saw them
* derecurse blocks helper, and use it in SimplifyLocalsAlon Zakai2016-04-071-8/+6
|
* rewrite SimplifyLocals to use FastExecutionWalkerAlon Zakai2016-04-071-12/+71
|
* Some cleanup.Michael Bebenita2016-01-141-1/+1
|
* Use LLVM style static polymorphism for WasmVisitors.Michael Bebenita2016-01-131-2/+2
|
* A more generic compiler pass system.Michael Bebenita2016-01-131-1/+1
|
* use simplify-locals by defaultAlon Zakai2016-01-091-0/+1
|
* start work on SimplifyLocalsAlon Zakai2016-01-091-0/+43