summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* fix handling of an if in a tee without an else, in coalesce-localsAlon Zakai (kripken)2017-07-132-0/+22
|
* infinite loops have side effectsAlon Zakai (kripken)2017-07-134-7/+64
|
* Merge pull request #1087 from WebAssembly/fuzz-2Alon Zakai2017-07-1222-77/+849
|\ | | | | Fuzz fixes
| * fix handling of unreachable br values in merge-blocksAlon Zakai (kripken)2017-07-112-0/+28
| |
| * fix coalesce-locals handling of set/tee local of an unreachable; we still ↵Alon Zakai (kripken)2017-07-113-12/+55
| | | | | | | | need the value, as it may do things
| * fix block removal in remove-unused-brs, even if not taken, if named, we must ↵Alon Zakai (kripken)2017-07-112-0/+71
| | | | | | | | preserve it
| * changing a set to a tee or vice versa needs to take into account the value ↵Alon Zakai (kripken)2017-07-113-3/+21
| | | | | | | | may be unreachable
| * handle unary and binary nodes that have implicit traps in vacuumAlon Zakai (kripken)2017-07-114-0/+43
| |
| * fix Const finalization and use it properly in br finalization in PrecomputeAlon Zakai (kripken)2017-07-112-0/+67
| |
| * loads may trap, do not remove them in vacuum unless the pass options allow thatAlon Zakai (kripken)2017-07-119-62/+446
| |
| * properly handle if arm removal in vacuumAlon Zakai (kripken)2017-07-112-0/+42
| |
| * add the option to seek named breaks, not just taken breaks; refactor headers ↵Alon Zakai (kripken)2017-07-112-0/+28
| | | | | | | | to make this practical
| * finalize new drops in SimplifyLocalsAlon Zakai (kripken)2017-07-112-0/+14
| |
| * don't remove unreachable nodes in vaccuum, it can alter types, and dce does ↵Alon Zakai (kripken)2017-07-112-3/+37
| | | | | | | | that anyhow, let it do it's thing
* | add docs and error hints when a Call should be a CallImport (#1081)Alon Zakai2017-07-112-0/+35
|/ | | | | | * add docs and error hints when a Call should be a CallImport * fix binaryen API docs in docs/
* Add IR, parsing, printing, and binary for atomic cmpxchg (#1083)Derek Schuff2017-07-104-0/+132
|
* Add IR, parsing and binary support for AtomicRMW instructions from wasm ↵Derek Schuff2017-07-064-5/+145
| | | | | threads proposal (#1082) Also leave a stub (but valid) visitAtomicRMW in the visitor template so that not all visitors need to implement this function yet.
* Code folding (#1076)Alon Zakai2017-06-2811-24885/+27472
| | | | | | | | | | | | | | | | Adds a pass that folds code, i.e. merges it when possible. See details in comment in the pass implementation cpp. This is enabled by default in -Os and -Oz. Seems risky to enable anywhere else, as it does add branches - likely predictable ones so maybe no slowdown, but still some risk. Code size numbers: wasm-backend: 196331 + binaryen -Os (before): 182598 + binaryen -Os (with folding): 181943 asm2wasm -Os (before): 172463 asm2wasm -Os (with folding): 168774 So this reduces wasm-backend output by an additional 0.5% than it could before. Mainly this is because the wasm backend already has code folding, whereas on asm2wasm output, where we didn't have folding before, this saves over 2%. The 0.5% improvement on the wasm backend's output might be because this can fold more types of code than LLVM can (it can fold nested control flow, in particular).
* Add atomic loads and stores (#1077)Derek Schuff2017-06-284-0/+290
| | | | | Add IR, wast and binary support for atomic loads and stores. Currently all IR generated by means other than parsing wast and binary files always generates non-atomic accesses, and optimizations have not yet been made aware of atomics, so they are certainly not ready to be used yet.
* Runtime.stackAlloc should grow down for wasm (#1073)jgravelle-google2017-06-2884-504/+252
| | | | | | * Runtime.stackAlloc should grow down for wasm * stackAlloc should align properly; update tests
* Add shared memories (#1069)Derek Schuff2017-06-2713-0/+38
| | | | | Begin to implement wasm threading proposal in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md This PR just has shared memory attribute with wast and binary support.
* Fix auto_update_tests for printing/minifier tests (#1071)Derek Schuff2017-06-273-1/+118
| | | | | It was using wasm-shell instead of wasm-opt to print. This was emitting an error and empty output. Also this means that the min.wast test input didn't get updated along with the spec, so I fixed that as well.
* Consistently handle possible traps in all cases (#1062)Alon Zakai2017-06-228-44/+224
| | | | | | * consistently handle possible traps in asm.js ffi results * consistently handle possible traps in i64/float conversions
* Revert "Update known failures running s2wasm results in wasm-shell (#1057)" ↵Sam Clegg2017-06-221-3/+12
| | | | | (#1063) This reverts commit 722e6a1893b7d662e536da206835821b2096c0ee.
* Update known failures running s2wasm results in wasm-shell (#1057)Sam Clegg2017-06-201-12/+3
| | | | | The two new failures are calling aboirt(). They date back to before the LKGR build: https://wasm-stat.us/builders/linux/builds/20068 So its hard to say when they started failing.
* Untee pass (#1053)Alon Zakai2017-06-142-0/+60
|
* S-expression parsing in C API and binaryen.js (#1050)Alon Zakai2017-06-133-7/+50
| | | | | | * add C API and binaryen.js support for parsing s-expressions * update js builds and tests
* SSA pass (#1049)Alon Zakai2017-06-136-0/+1188
| | | | | | | * Add SSA pass which ensures a single assign for each local, except for merged locals where we ensure exactly a single assign from one of the paths leading to that use * Also add InstrumentLocals pass, useful for debugging locals (similar to InstrumentMemory but for locals) * Fix a PickLoadSigns bug with tees not being ignored, which was not noticed until now because we ran it on flatter output by default, but the ssa pass uncovered the bug
* Support new result syntax for if/loop/block (#1047)Sam Clegg2017-06-12127-1817/+1817
| | | | | | Support both syntax formats in input since the old spec tests still need to be parsable.
* Optimize/merge duplicate function types (#1041)Alon Zakai2017-06-1216-52/+90
|
* update testsSam Clegg2017-06-091-4/+4
|
* C API fixes (#1042)Alon Zakai2017-06-071-12/+12
| | | | | | * fix mutex usage in C API, and some minor cleanup around it too * update testcase that was forgotten to be updated before
* Update binaryen-c/binaryen.js, fixes #1028, fixes #1029 (#1030)Daniel Wirtz2017-06-076-76/+88
| | | This PR adds global variable support (addGlobal, getGlobal, setGlobal), host operations (currentMemory, growMemory), a few utility functions (removeImport, removeExport, getFunctionTypeBySignature with the latter being scheduled for removal once a better alternative is in place) and it introduces an additional argument to specify the result type in BinaryenBlock (effectively breaking the C-API but retaining previous behaviour by introducing the BinaryenUndefined() type for this purpose). Additionally, it enables compilation with exception support in build-js.sh as exceptions are thrown and caught when optimizing endless loops, intentionally resulting in an unreachable opcode. Affected test cases have been updated accordingly.
* S2wasm runtime funcs (#1027)jgravelle-google2017-06-0584-0/+3024
| | | | | | | | | | | | | | | | * Generate stackSave function in s2wasm * Generate stackAlloc in s2wasm * Generate stackRestore in s2wasm * Update dot_s tests for runtime functions * Add s2wasm check for exporting runtime functions * Fix flake8 for s2wasm.py * Rename wasmBuilder to builder
* validate returned values in all cases, even if the function returns none we ↵Alon Zakai2017-06-025-6/+8
| | | | should still not have returns with a value, etc. update spec tests to remove some stacky tests that do not fit these new validation rules (#1034)
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-0116-84/+317
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* simplify reloop testcaseAlon Zakai2017-05-242-5/+12
|
* relooper improvementsAlon Zakai (kripken)2017-05-203-4/+67
|
* use TypeUpdater in vacuumAlon Zakai (kripken)2017-05-2013-7554/+7418
|
* afl-fuzz bug fixes (#1018)Alon Zakai2017-05-204-0/+290
| | | | | | | | * values cannot flow through an if without an else, they never return a value * check pass tests in pass-debug mode too * add missing finalization in binary reading
* Validate finalization (#1014)Alon Zakai2017-05-1831-212/+3438
| | | | | | | * 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-176-67/+151
|
* Re-reloop pass (#1009)Alon Zakai2017-05-164-0/+1299
| | | | | This adds a pass that converts to a CFG, runs the relooper, and re-generates wasm from that. This depends on flatten-control-flow being run before. The main goal here is to help code generators other than asm2wasm (which already receives relooped code from fastcomp).
* merge blocks before and after remove-unused-brsAlon Zakai (kripken)2017-05-105-61/+62
|
* allow values to flow out of loops in RemoveUnneededBrs, and simplify some ↵Alon Zakai (kripken)2017-05-109-1126/+1101
| | | | unnecessary complexity in that pass as well
* Flatten control flow pass (#999)Alon Zakai2017-05-102-0/+1953
| | | | | | | | | | | This pass flattens out control flow in order to achieve 2 properties: * Control flow structures (block, loop, if) and control flow operations (br, br_if, br_table, return, unreachable) may only be block children, a loop body, or an if-true or if-false. (I.e., they cannot be nested inside an i32.add, a drop, a call, an if-condition, etc.) * Disallow block, loop, and if return values, i.e., do not use control flow to pass around values. As a result, expressions cannot contain control flow, and overall control flow is simpler, more structured, and more "flat". This should make things like re-relooping wasm code much easier, as they can run after the cfg is flattened
* asm2wasm: properly infer return type of a call inside a sequence (#1006)Alon Zakai2017-05-097-12/+126
|
* fix autoDrop, now that we properly set block types, unreachable can easily ↵Alon Zakai2017-05-097-0/+183
| | | | happen, and autoDrop wasn't handling it (#1005)
* Unreachable typing fixes (#1004)Alon Zakai2017-05-097-30/+295
| | | | | | | | | | | | * fix type of drop, set_local, set_global, load, etc: when operand is unreachable, so is the node itself * support binary tests properly in test/passes * fix unreachable typing of blocks with no name and an unreachable child * fix continue emitting in asm2wasm * properly handle emitting of unreachable load
* fix an afl-fuzz bug where precompute alters a br to remove its condition, ↵Alon Zakai2017-05-082-0/+31
| | | | but does not properly modify the type (#1000)