summaryrefslogtreecommitdiff
path: root/src/passes/OptimizeInstructions.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* do not combine a load/store offset with a constant pointer if it would wrap ↵Alon Zakai (kripken)2017-07-291-2/+9
| | | | a negative value to a positive one, as trapping is tricky
* fix off-by-one in assertion in optimize-instructionsAlon Zakai2017-07-171-1/+1
|
* optimize shifts of 0Alon Zakai2017-07-131-0/+6
|
* add the option to seek named breaks, not just taken breaks; refactor headers ↵Alon Zakai (kripken)2017-07-111-1/+2
| | | | to make this practical
* 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.
* optimize if and select in the case their values are identical (#1013)Alon Zakai2017-05-171-0/+39
|
* Fix comparisons of sign-extends to weird constants (#956)Alon Zakai2017-03-211-6/+31
| | | | * fix eq/ne of sign-ext with a constant, when the constant can never be equal to it as it has the effective sign bit but not the upper bits above it set, which the sign-ext would emit
* fix sign-ext opt issues (#935)Alon Zakai2017-03-091-11/+15
| | | | | | * fix a bug where compared sign-exts of different sizes were turned into zero-exts * fix a bug where we consider an almost sign-ext as ok to change the sign of a load inside it, ignoring that the load has the extra shifting
* Default Walker subclasses to using Visitor<SubType> (#921)jgravelle-google2017-02-231-3/+3
| | | | Most module walkers use PostWalker<T, Visitor<T>>, let that pattern be expressed as simply PostWalker<T>
* refactor sign/zero extension code into nice headers, and prepare ↵Alon Zakai2017-02-161-97/+23
| | | | PickLoadSigns pass
* fix and clean up fallthrough logic in OptimizeInstructionsAlon Zakai (kripken)2017-02-161-22/+18
|
* optimize a compare of a load_s and a sign-extend into a load_u and a cheaper ↵Alon Zakai (kripken)2017-02-161-0/+18
| | | | zero-extend
* take into account loads into local info in OptimizeInstructionsAlon Zakai (kripken)2017-02-161-7/+10
|
* use local info about maxBits and sign-extendedness in OptimizeInstructionsAlon Zakai (kripken)2017-02-161-11/+120
| | | | fix the maxBits of a signed load, which this uncovered - all the bits may be used in such a case
* remove unneeded masks using getMaxBitsAlon Zakai (kripken)2017-02-161-3/+16
|
* tiny refactoring in OptimizeInstructions, for clarityAlon Zakai (kripken)2017-02-161-7/+8
|
* fix fuzz testcase, xor maxBits is the max, not the minAlon Zakai (kripken)2017-02-161-2/+2
|
* handle fallthrough values in load_s/u and sign/zero-extend optimizationAlon Zakai (kripken)2017-02-161-6/+30
|
* handle load in getMaxBitsAlon Zakai (kripken)2017-02-161-0/+2
|
* handle tee_local in getMaxBitsAlon Zakai (kripken)2017-02-161-0/+3
|
* optimize out a sign-ext into a store of the same sizeAlon Zakai (kripken)2017-02-161-0/+6
|
* optimize out add/sub of 0Alon Zakai (kripken)2017-02-161-1/+9
|
* optimize sign-extends to a booleanAlon Zakai (kripken)2017-02-161-0/+4
|
* optimize sign-extends to eqzAlon Zakai (kripken)2017-02-161-0/+7
|
* optimize sign-extends to neAlon Zakai (kripken)2017-02-161-2/+2
|
* Optimize "squared" operations (#905)Alon Zakai2017-02-161-23/+86
| | | | * optimize 'almost' sign extends: when we can remove one entirely, then extra shifts can be left behind. with that in place, we can then optimize 'squared' operations like shl on shl, as doing so does not break our sign extend opts
* optimize linear sums (#904)Alon Zakai2017-02-161-0/+110
|
* Optimize sign-extends (#902)Alon Zakai2017-02-161-18/+139
| | | | | | * optimize sign-extend output * optimize sign-extend input
* Hide dead code (#909)Loo Rong Jie2017-02-151-0/+8
|
* Improve handling of implicit traps (#898)Alon Zakai2017-02-061-4/+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
* Make ast_utils into a library (#892)Derek Schuff2017-01-311-45/+47
| | | | Split ExpressionAnalyzer and ExpressionManipulator into cpp files, and turn their giant template functions into simple functions which take a callback. More organization, fewer mammoth headers, makes the build a few seconds faster, and the binaries a couple MB smaller.
* Fix regression from #850 (#851)Alon Zakai2016-11-301-27/+1
| | | | | | * fix regression from #850 - it is not always safe to fold added offsets into load/store offsets, as the add wraps but offset does not * small refactoring to simplify asm2wasm pass invocation
* Optimize added factors into load/store offsets (#850)Alon Zakai2016-11-291-0/+40
| | | | | * optimize added factors into load/store offsets, removing the add * optimize offset of load/store of a constant into the constant
* optimize booleans through i32.orAlon Zakai2016-11-041-2/+6
|
* recurse in optimizeBoolean (#809)Alon Zakai2016-10-271-0/+10
|
* optimize ne of 0 in a boolean context (#808)Alon Zakai2016-10-271-7/+17
|
* Conditionalize boolean operations based on cost (#805)Alon Zakai2016-10-261-0/+46
| | | When we have expensive | expensive, and both are boolean, then we can execute one of them conditionally if it doesn't have side effects.
* Optimize out bool & 1 (#804)Alon Zakai2016-10-251-0/+10
| | | | | | * asm.js corrections to unit.asm.js test * optimize out bool&1
* Optimize to i64.store[less] (#792)Alon Zakai2016-10-201-4/+10
|
* optimize out i32.and of -1Alon Zakai2016-10-151-4/+9
|
* optimize loads and stores that mask their values, as the load/store ↵Alon Zakai2016-10-151-0/+28
| | | | operation masks itself
* Type check block/loop/if sigs (#717)Alon Zakai2016-09-281-0/+60
| | | | | | * type check using block/loop/if types provided in text and binary formats. * print if and loop sigs which were missing. * remove dsl from OptimizeInstructions as after those changes it needs rethinking.
* refactor wasm.h to remove numericIndex hacks, and move indexing to the parsersAlon Zakai2016-09-211-9/+14
|
* clean up database-ensuring code using the new prepareToRun methodAlon Zakai2016-09-121-9/+6
|
* refactor an optimizeBoolean methodAlon Zakai2016-09-101-20/+24
|
* optimize eqz^2 in select and br_ifAlon Zakai2016-09-101-8/+23
|
* flip select-eqz when possibleAlon Zakai2016-09-071-2/+13
|
* optimize out a set of a get of a globalAlon Zakai2016-09-071-0/+8
|
* optimize loads+shifts into signed loadsAlon Zakai2016-09-071-0/+27
|
* ensure we create the OptimizeInstructions database on demand, avoiding ↵Alon Zakai2016-09-071-3/+17
| | | | global ctors