Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Improve getFallthrough (#1643) | Alon Zakai | 2018-08-27 | 1 | -18/+2 | |
| | | | | | That method looks through tee_locals and other operations that receive a value and let it flow through them, like a block's final value, etc. It just handled a few such operations, with this PR all of them should be handled. Also refactor it out of the OptimizeInstructions pass as I think it may be useful for propagating returned constants. | |||||
* | Fix MSVC warnings when compiling the binaryen target (#1535) | Daniel Wirtz | 2018-05-09 | 1 | -1/+1 | |
| | ||||||
* | optimize selects of constant conditions (#1516) | Alon Zakai | 2018-04-27 | 1 | -0/+20 | |
| | ||||||
* | More math opts (#1507) | Alon Zakai | 2018-04-11 | 1 | -3/+20 | |
| | | | `xor` of 0, `and` and `or` of -1 | |||||
* | More simple math opts (#1506) | Alon Zakai | 2018-04-11 | 1 | -2/+72 | |
| | | | | | * Optimize shifts of 0. * Optimize f(x, x) for various f (e.g., x & x => x). | |||||
* | Some simple integer math opts (#1504) | Alon Zakai | 2018-04-11 | 1 | -15/+121 | |
| | | | | | | | | | Stuff like x + 5 != 2 => x != -3. Also some cleanups of utility functions I noticed while writing this, isTypeFloat => isFloatType. Inspired by https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/gen/generic.rules | |||||
* | fix some comment typos (#1425) | Nathan Froyd | 2018-02-14 | 1 | -2/+2 | |
| | ||||||
* | More simple math opts (#1414) | Alon Zakai | 2018-02-14 | 1 | -2/+45 | |
| | | | | | | | | * optimize more simple math operations: mul of 0, or of 0, and of 0, mul of 1, mul of a power of 2, urem of a power of 2 * fix asm2wasm callImport parsing: the optimizer may get rid of the added offset to a function table * update js builds | |||||
* | Rename WasmType => Type (#1398) | Alon Zakai | 2018-02-02 | 1 | -3/+3 | |
| | | | | * rename WasmType to Type. it's in the wasm:: namespace anyhow, and without Wasm- it fits in better alongside Index, Address, Expression, Module, etc. | |||||
* | optimize out 0-x, a zero only used to negate an int, when possible (#1365) | Alon Zakai | 2018-01-17 | 1 | -1/+37 | |
| | ||||||
* | De-morgan's "and" law (#1297) | Alon Zakai | 2017-11-30 | 1 | -0/+26 | |
| | | | | | (eqz X) and (eqz Y) === eqz (X or Y) Normally de-morgan's laws apply only to boolean vars, but for the and (but not or or xor) version, it works in all cases (both sides are true iff X and Y have all zero bits). | |||||
* | add i64_atomics_* support to asm2wasm (#1262) | Alon Zakai | 2017-11-14 | 1 | -1/+2 | |
| | | | | | | * add i64_atomics_* support to asm2wasm * OptimizeInstructions: atomic loads can't be signed | |||||
* | notation change: AST => IR (#1245) | Alon Zakai | 2017-10-24 | 1 | -7/+7 | |
| | | | 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). | |||||
* | only look at the |signed| field of loads if it is relevant (#1235) | Alon Zakai | 2017-10-23 | 1 | -2/+4 | |
| | ||||||
* | Add a superclass typedef to WalkerPass to simplify overrides (#1211) | jgravelle-google | 2017-10-04 | 1 | -1/+1 | |
| | ||||||
* | fix regression from 45d88e3ef5f895b2fde77e3588f84d66e67bdd88 - left may not ↵ | Alon Zakai | 2017-10-02 | 1 | -1/+1 | |
| | | | | exist, need to return curr->left, after that change (#1207) | |||||
* | fix optimize-instructions handling of shifts by a zero or of a zero when ↵ | Alon Zakai | 2017-10-02 | 1 | -2/+3 | |
| | | | | combining added constants (#1206) | |||||
* | Merge pull request #1175 from WebAssembly/fuzz | Alon Zakai | 2017-09-10 | 1 | -6/+23 | |
|\ | | | | | Fuzzer improvements + fixes | |||||
| * | when if arms are identical, merging them may change the type of the if, if ↵ | Alon Zakai | 2017-09-06 | 1 | -6/+23 | |
| | | | | | | | | it has a forced type | |||||
* | | Add support for sign-extension operators from threading proposal (#1167) | Derek Schuff | 2017-09-06 | 1 | -0/+2 | |
|/ | | | These are not atomic operations, but are added with the atomic operations to keep from having to define atomic versions of all the sign-extending loads (an atomic zero-extending load + signext operation can be used instead). | |||||
* | Return to more structured type rules for block and if (#1148) | Alon Zakai | 2017-09-05 | 1 | -0/+8 | |
| | | | | | | | | * 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. | |||||
* | fix off-by-one error in clz/ctz/popcount used bits computation | Alon Zakai | 2017-08-01 | 1 | -2/+2 | |
| | ||||||
* | use effective shifts in more places in optimize-instructions | Alon Zakai (kripken) | 2017-08-01 | 1 | -2/+2 | |
| | ||||||
* | review comments | Alon Zakai (kripken) | 2017-07-31 | 1 | -5/+5 | |
| | ||||||
* | handle squared shifts of an unreachable | Alon Zakai (kripken) | 2017-07-31 | 1 | -2/+2 | |
| | ||||||
* | fix optimizing two shifts into one; if the number of effective shifts ↵ | Alon Zakai (kripken) | 2017-07-30 | 1 | -3/+11 | |
| | | | | overflows, it is not vali to just add them | |||||
* | do not swap elements in conditionalizeExpensiveOnBitwise if they invalidate ↵ | Alon Zakai (kripken) | 2017-07-29 | 1 | -6/+9 | |
| | | | | each other - it is not enough to check side effects, we must check the interaction as well | |||||
* | refactor effective shift size computation | Alon Zakai | 2017-07-29 | 1 | -3/+3 | |
| | ||||||
* | fix shl shift computation in getMaxBits | Alon Zakai | 2017-07-29 | 1 | -1/+1 | |
| | ||||||
* | fix shift computation in getMaxBits - in wasm only the lower 5 bits matter ↵ | Alon Zakai | 2017-07-29 | 1 | -2/+2 | |
| | | | | for a 32-bit shift | |||||
* | do not combine a load/store offset with a constant pointer if it would wrap ↵ | Alon Zakai (kripken) | 2017-07-29 | 1 | -2/+9 | |
| | | | | a negative value to a positive one, as trapping is tricky | |||||
* | fix off-by-one in assertion in optimize-instructions | Alon Zakai | 2017-07-17 | 1 | -1/+1 | |
| | ||||||
* | optimize shifts of 0 | Alon Zakai | 2017-07-13 | 1 | -0/+6 | |
| | ||||||
* | add the option to seek named breaks, not just taken breaks; refactor headers ↵ | Alon Zakai (kripken) | 2017-07-11 | 1 | -1/+2 | |
| | | | | to make this practical | |||||
* | Validate finalization (#1014) | Alon Zakai | 2017-05-18 | 1 | -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 Zakai | 2017-05-17 | 1 | -0/+39 | |
| | ||||||
* | Fix comparisons of sign-extends to weird constants (#956) | Alon Zakai | 2017-03-21 | 1 | -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 Zakai | 2017-03-09 | 1 | -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-google | 2017-02-23 | 1 | -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 Zakai | 2017-02-16 | 1 | -97/+23 | |
| | | | | PickLoadSigns pass | |||||
* | fix and clean up fallthrough logic in OptimizeInstructions | Alon Zakai (kripken) | 2017-02-16 | 1 | -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-16 | 1 | -0/+18 | |
| | | | | zero-extend | |||||
* | take into account loads into local info in OptimizeInstructions | Alon Zakai (kripken) | 2017-02-16 | 1 | -7/+10 | |
| | ||||||
* | use local info about maxBits and sign-extendedness in OptimizeInstructions | Alon Zakai (kripken) | 2017-02-16 | 1 | -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 getMaxBits | Alon Zakai (kripken) | 2017-02-16 | 1 | -3/+16 | |
| | ||||||
* | tiny refactoring in OptimizeInstructions, for clarity | Alon Zakai (kripken) | 2017-02-16 | 1 | -7/+8 | |
| | ||||||
* | fix fuzz testcase, xor maxBits is the max, not the min | Alon Zakai (kripken) | 2017-02-16 | 1 | -2/+2 | |
| | ||||||
* | handle fallthrough values in load_s/u and sign/zero-extend optimization | Alon Zakai (kripken) | 2017-02-16 | 1 | -6/+30 | |
| | ||||||
* | handle load in getMaxBits | Alon Zakai (kripken) | 2017-02-16 | 1 | -0/+2 | |
| | ||||||
* | handle tee_local in getMaxBits | Alon Zakai (kripken) | 2017-02-16 | 1 | -0/+3 | |
| |