summaryrefslogtreecommitdiff
path: root/src/passes/AvoidReinterprets.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Modernize code to C++17 (#3104)Max Graey2021-11-221-9/+6
|
* Use the new module version of EffectAnalyzer (#4116)Alon Zakai2021-08-311-9/+8
| | | | | | | | | | | This finishes the refactoring started in #4115 by doing the same change to pass a Module into EffectAnalyzer instead of features. To do so this refactors the fallthrough API and a few other small things. After those changes, this PR removes the old feature constructor of EffectAnalyzer entirely. This requires a small breaking change in the C API, changing BinaryenExpressionGetSideEffects's feature param to a module. That makes this change not NFC, but otherwise it is.
* Initial implementation of "Memory64" proposal (#3130)Wouter van Oortmerssen2020-09-181-3/+6
| | | Also includes a lot of new spec tests that eventually need to go into the spec repo
* AvoidReinterprets should not remove code around a reinterpret's value's ↵Alon Zakai2020-07-281-3/+3
| | | | | | | | | | | | | | | | | fallthrough (#2989) We can turn a reinterpret of a load into a different load, and so forth, but if the reinterpret has a non-load child with a load fallthrough, that's not good enough - we can't remove the extra code: (reinterpret (block ..extra code.. (load) ) ) That can't be turned into a load of the flipped type.
* Add EH support for OptimizeInstructions (#2608)Heejin Ahn2020-02-051-9/+20
| | | | | | - Adds support for `Try` in `optimizeBoolean` function - Adds support for `Try` in `getFallThrough` function - Adds approximate cost values for instructions in EH and reference types proposals.
* [NFC] Enforce use of `Type::` on type names (#2434)Thomas Lively2020-01-071-4/+4
|
* Move Type-related functions into Type class (NFC) (#2556)Heejin Ahn2019-12-291-5/+6
| | | | | | | | | | | Several type-related functions currently exist outside of `Type` class and thus in the `wasm`, effectively global, namespace. This moves these functions into `Type` class, making them either member functions or static functions. Also this renames `getSize` to `getByteSize` to make it not to be confused with `size`, which returns the number of types in multiple types. This also reorders the order of functions in `wasm-type.cpp` to match that of `wasm-type.h`.
* Reflect instruction renaming in code (#2128)Heejin Ahn2019-05-211-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reflected new renamed instruction names in code and tests: - `get_local` -> `local.get` - `set_local` -> `local.set` - `tee_local` -> `local.tee` - `get_global` -> `global.get` - `set_global` -> `global.set` - `current_memory` -> `memory.size` - `grow_memory` -> `memory.grow` - Removed APIs related to old instruction names in Binaryen.js and added APIs with new names if they are missing. - Renamed `typedef SortedVector LocalSet` to `SetsOfLocals` to prevent name clashes. - Resolved several TODO renaming items in wasm-binary.h: - `TableSwitch` -> `BrTable` - `I32ConvertI64` -> `I32WrapI64` - `I64STruncI32` -> `I64SExtendI32` - `I64UTruncI32` -> `I64UExtendI32` - `F32ConvertF64` -> `F32DemoteI64` - `F64ConvertF32` -> `F64PromoteF32` - Renamed `BinaryenGetFeatures` and `BinaryenSetFeatures` to `BinaryenModuleGetFeatures` and `BinaryenModuleSetFeatures` for consistency.
* Fix AvoidReinterprets on reinterpreted loads of fewer than the full size (#2123)Alon Zakai2019-05-171-3/+13
| | | | | | * fix * fix style
* Fix an infinite loop in avoid-reinterprets in unreachable code with loops of ↵Alon Zakai2019-05-171-0/+7
| | | | | gets (#2118) In unreachable code, a get may have a single set that assigns to it, and that set may be assigned to by that very get.
* wasm2js: avoid reinterprets (#2094)Alon Zakai2019-05-101-0/+181
In JS a reinterpret is especially expensive, as we implement it as a write to a temp buffer and a read using another view. This finds places where we load a value from memory, then reinterpret it later - in that case, we can load it using another view, at the cost of another load and another local. This is helpful on things like Box2D, where there are many reinterprets due to the main 2D vector class being an union over two floats/ints, and LLVM likes to do a single i64 load of them.