summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a vacuum bug with loads changing the type (#2124)Alon Zakai2019-05-172-0/+133
| | | This happened on wasm2js, where implicit traps are off by default, and this bug is specific to that (less-tested) mode.
* Remove llvm_autogenerated tests (#2120)Heejin Ahn2019-05-1754-12036/+0
| | | After s2wasm was removed, these tests don't seem to be used anymore.
* fix a dae fuzz bug (#2121)Alon Zakai2019-05-172-0/+103
|
* Fix an infinite loop in avoid-reinterprets in unreachable code with loops of ↵Alon Zakai2019-05-174-0/+97
| | | | | 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.
* Features C/JS API (#2049)Thomas Lively2019-05-175-0/+61
| | | | | Add feature handling to the C/JS APIs. No features are enabled by default, so all used features will have to be explicitly enabled in order for modules to validate.
* Allow color API to enable and disable colors (#2111)Siddharth2019-05-171-0/+16
| | | | | | This is useful for front-ends which wish to selectively enable or disable coloring. Also expose these APIs from the C API.
* Add globals to metrics (#2110)Heejin Ahn2019-05-166-0/+16
|
* wasm2js: more coercion optimization (#2109)Alon Zakai2019-05-154-1/+170
|
* wasm2js: remove unnecessary labels (#2108)Alon Zakai2019-05-154-5/+5
|
* wasm2js: optimize away unneeded load coercions (#2107)Alon Zakai2019-05-1594-1/+238
|
* wasm2js: Emit table in a way that is friendly to emscripten minification (#2102)Alon Zakai2019-05-132-2/+4
| | | Set it to a local in the asmFunc scope, so that minifiers can easily see it's a simple local value (instead of using it as an upvar from the parameters higher up, which was how the emscripten glue was emitting it).
* wasm2js: precompute bitwise operations (#2101)Alon Zakai2019-05-1315-183/+183
| | | This happens on e.g. an i32 load of a constant offset, then we have constant >> 2.
* Add missing methods for globals to binaryen.js (#2099)Heejin Ahn2019-05-137-9/+76
| | | | | - Print `globals` array in the tracing mode like other arrays (`functions`, `exports`, `imports`, ...) - Add accessor functions for globals
* Look through fallthrough values in precompute-propagate (#2093)Alon Zakai2019-05-1013-357/+104
| | | This helps quite a lot on wasm2js.
* wasm2js: avoid reinterprets (#2094)Alon Zakai2019-05-1013-324/+469
| | | | | 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.
* Add except_ref type (#2081)Heejin Ahn2019-05-078-2/+35
| | | | This adds except_ref type, which is a part of the exception handling proposal.
* wasm2js: optimize booleans (#2090)Alon Zakai2019-05-073-0/+26
|
* Add exception handling feature (#2083)Heejin Ahn2019-05-031-0/+3
| | | This only adds the feature and its flag and not the instructions yet.
* wasm2js: optimize loads (#2085)Alon Zakai2019-05-0394-124/+36
| | | | When loading a boolean, prefer the signed heap (which is more commonly used, and may be faster). We never use HEAPU32 (HEAP32 is always enough), just remove it.
* wasm2js: avoid some slow operations when not optimizing (#2082)Alon Zakai2019-05-0319-3747/+4081
| | | Without this PR, wasm2js0.test_printf in emscripten took an extremely long time to compile.
* wasm2js: don't emit obviously unnecessary parens (#2080)Alon Zakai2019-05-0249-8688/+5568
| | | A minifier would probably remove them later anyhow, but they make reading the code annoying and hard.
* wasm2js: ignore implicit traps (#2079)Alon Zakai2019-05-027-58/+31
| | | | | We don't actually try to emit traps for loads, stores, invalid float to ints, etc., so when optimizing we may as well do so under the assumption those traps do not exist. This lets us emit nice code for a select whose operands are loads, for example - otherwise, the values seem to have side effects.
* Optimize mutable globals (#2066)Alon Zakai2019-05-0215-65/+146
| | | | | | | If a global is marked mutable but not assigned to, make it immutable. If an immutable global is a copy of another, use the original, so we can remove the duplicates. Fixes #2011
* Add a pass to lower unaligned loads and stores (#2078)Alon Zakai2019-05-025-51/+711
| | | | | This replaces the wasm2js code that lowered them to pessimistic (1-byte aligned) loads and stores. The new pass will do the optimal thing, keeping 2-byte alignment where possible. This is also nicer as a standalone pass, which has the simple property that after it runs all loads and stores are aligned, instead of some code scattered inside wasm2js.
* wasm2js: don't run coalesce-locals if not optimizing (#2076)Alon Zakai2019-05-0151-16963/+22097
| | | That pass is very slow on unoptimized code (super-linear on the number of locals, which if unoptimized can be massive due to flatten).
* wasm2js: run more optimizations (#2073)Alon Zakai2019-05-0162-22433/+17246
| | | In particular, coalesce-locals is useful even if closure is run later (apparently it finds stuff closure can't).
* wasm2js: run full optimizations during the pipeline (#2071)Alon Zakai2019-04-3078-5965/+22887
| | | | | We flatten for the i64 lowering etc. passes, and it is worth optimizing afterwards, to clean up stuff they created. That is run if the user ran wasm2js with an optimization level (like wasm2js -O3). Split the test files to check both optimized and unoptimized code.
* wasm2js: optimize away casts going into a suitable store (#2069)Alon Zakai2019-04-303-6/+31
|
* I64ToI32Lowering: don't use alignment 1 everywhere (#2070)Alon Zakai2019-04-305-8/+296
| | | If an i64 load/store that is being broken up has higher alignment, use that.
* wasm2js: optimize switches (#2067)Alon Zakai2019-04-306-73950/+12
| | | | | | | | | | Don't emit unneeded breaks in switch cases, instead do case X: case Y: .. case W: break .. for each group. Also, the group with the default doesn't need any cases but the default itself.
* Properly handle optimizing out a set from inside the value of another set in ↵Alon Zakai2019-04-292-0/+51
| | | | | | | SimplifyLocals (#2064) Details in lengthy comment in the source. Fixes #2063
* Fix CI (#2061)Alon Zakai2019-04-261-1/+1
| | | | | | | We had CI breakage that prevented this from being noticed before. * Make binaryen.js not use NO_FILESYSTEM - need to investigate why recent emscripten changes broke our usage of that flag. * Update a binaryen.js test.
* wasm2js: remove unneeded break/continue labels (#2058)Alon Zakai2019-04-2612-56/+56
|
* wasm2js2: optimize call_indirect and select operands (#2056)Alon Zakai2019-04-2513-95/+231
| | | Don't use temp vars to reorder them unless we need to.
* wasm2js: support non-constant indexes for memory and table segments (#2055)Alon Zakai2019-04-252-0/+87
| | | Mostly what we need for dynamic linking, at least on the binaryen side.
* wasm2js: optimize loops and eqz (#2051)Alon Zakai2019-04-2518-206/+178
|
* Remove f32 legalization from LegalizeJSInterface (#2052)Sam Clegg2019-04-2540-1248/+484
| | | | | As well as i64 splitting this pass was also converting f32 to f64 at the wasm boundry. However it appears this is not actually useful and makes somethings (such as dynamic linking) harder.
* wasm2js: more js optimization (#2050)Alon Zakai2019-04-2448-2431/+1449
| | | | | | * Emit ints as signed, so -1 isn't a big unsigned number. * x - -c (where c is a constant) is larger than x + c in js (but not wasm) * +(+x) => +x * Avoid unnecessary coercions on calls, return, load, etc. - we just need coercions when entering or exiting "wasm" (not internally), and on actual operations that need them.
* wasm2js: start to optionally optimize the JS (#2046)Alon Zakai2019-04-2448-4989/+5011
| | | Removes redundant | 0s and similar things. (Apparently closure compiler doesn't do that, so makes sense to do here.)
* wasm2js: emit quoted properties for the exports, to support closure compiler ↵Alon Zakai2019-04-2357-998/+998
| | | | (#2043)
* wasm2js: emit calls for memory growth helper only if memory growth is used ↵Alon Zakai2019-04-231-1/+1
| | | | (#2042)
* wasm2js: avoid non-ES5 stuff like "let" (#2041)Alon Zakai2019-04-2364-1164/+1164
| | | Also fix the fuzzer's handling of feature flags so that wasm2js can work.
* wasm2js: remove more code we don't need since we have flat IR (#2039)Alon Zakai2019-04-2215-480/+256
| | | Also run remove-unused-names which became more noticeably necessary after this change.
* Finish bulk memory support (#2030)Thomas Lively2019-04-221-0/+183
| | | | | | | Implement interpretation of remaining bulk memory ops, add bulk memory spec tests with light modifications, fix bugs preventing the fuzzer from running correctly with bulk memory, and fix bugs found by the fuzzer.
* wasm2js: get rid of some non-flat code assumptions (#2036)Alon Zakai2019-04-2214-445/+163
| | | We run flatten there, which lets us simplify things a lot. Turns out that for assertions we didn't run it, which is why we still needed the old non-flat code paths. This adds flatten there and removes that old code and assumptions.
* wasm2js: unreachability fixes (#2037)Alon Zakai2019-04-2214-1857/+2451
| | | Also test in pass-debug mode, for better coverage.
* wasm-emscripten-finalize: Handle relocatable code in AsmConstWalker (#2035)Sam Clegg2019-04-222-18/+7
| | | | | | | | | When replacing the first argument to an asm call, allow more complex expressions for expressing the address. This fixes the case where the first argument might be the result of adding a constant to __memory_base.
* wasm2js: fix printing of negated negative constants (#2034)Alon Zakai2019-04-222-0/+58
| | | It is invalid to print --5, we need to add a space - -5 so that it is valid JS to parse.
* wasm2js: use scratch memory properly (#2033)Alon Zakai2019-04-2213-2156/+2439
| | | | | | | This replaces all uses of __tempMemory__, the old scratch space location, with calls to function imports for scratch memory access. This lets us then implement those in a way that does not use the same heap as main memory. This avoids possible bugs with scratch memory overwriting something, or just in general that it has observable side effects, which can confuse fuzzing etc. The intrinsics are currently implemented in the glue. We could perhaps emit them inline instead (but that might limit asm.js optimizations, so I wanted to keep our options open for now - easy to change later). Also fixes some places where we used 0 as the scratch space address.
* wasm2js2 import fixes (#2031)Alon Zakai2019-04-1961-1017/+11252
| | | | | | * Don't assume function types exist in legalize-js-interface. * Properly handle (ignore) imports in RemoveNonJSOps - do not try to recurse into them. * Run legalize-js-interface and remove-unused-module-elements in wasm2js, the first is necessary, the last is nice to have.