summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Update call_indirect text syntax to match spec update (#1281)Derek Schuff2017-11-1375-354/+354
| | | | Function type gets its own element rather than being a part of the call_indirect (see WebAssembly/spec#599)
* Fix yet another BinaryenAddGlobal tracing issue (#1283)Daniel Wirtz2017-11-133-4/+19
| | | Now also includes a test.
* Added expression utility functions to binaryen-c/.js (#1269)Daniel Wirtz2017-11-112-1/+65
|
* Rereloop fuzz fix (#1259)Alon Zakai2017-11-093-18/+127
| | | | * fix relooper bug, ensure function body has right type, as relooper output does not flow stuff out, but wasm functions with a result do expect a flow value, so none is not an option. in other words, as the docs say, a relooper block must end with a terminator (return, unreachable, break, etc.) and not flow out.
* Fix binaryen.js's wasm2asm (#1257)Alon Zakai2017-11-014-53/+57
| | | | * fix wasm2asm in binaryen.js, the function locals may not all have names, so add them as necessary
* Added the ability to run specific optimization passes to binaryen-c/.js (#1252)Daniel Wirtz2017-10-302-0/+9
|
* Improve constant fuzzing (#1244)Alon Zakai2017-10-241-825/+705
| | | | | Generalize constant emitting in fuzzer, using +-1 and *+-1 effects to create more constants in a convenient way. Also workaround for a gcc-7.2/windows issue that we don't fully understand, but removing the 1, -1 from those pick() calls avoids the bug.
* fix safe-heap regression with handling of existing imports (#1237)Alon Zakai2017-10-242-0/+4048
|
* Emit binary function index in comment in text format, for convenience (#1232)Alon Zakai2017-10-20349-4048/+4048
|
* Atomics support in interpreter + optimizer + fuzz fixes for that (#1227)Alon Zakai2017-10-204-821/+791
|
* use simplify-locals in wasm2asm, so the output is not horribly verbose with ↵Alon Zakai2017-10-209-1224/+379
| | | | los of extra inefficient variables. this is more similar to the output we had before the flatten rewrite (#1229)
* Use the type system to check if something is flowed out of (#1224)Alon Zakai2017-10-162-12/+50
| | | | now that the type system has a proper unreachable, we don't need obviouslyDoesNotFlowOut
* Fixed parseFile() skipping every other line (#1223)Alexander Meißner2017-10-161-0/+1
| | | | | | | | * Fixed parseFile() skipping every other line Was caused by "s = strchr(s, '\n')" Also replaced recordFile() by parseFile() as they do exactly the same * Added parseFile() to process() in s2wasm.h
* fix ssaify bug where we failed to update the location of values as we moved ↵Alon Zakai2017-10-112-0/+64
| | | | them around, causing us to zero out the wrong thing in another place and ensuing hilarity (#1212)
* fix simplify-locals bug where we create a br_if value, which is dangerous if ↵Alon Zakai2017-10-112-0/+96
| | | | we are moving code out of the br_if's condition - the value executes before (#1213)
* fix re-reloop fuzz bug, we need to ensure a terminator in all relooper ↵Alon Zakai2017-10-113-2/+85
| | | | blocks (#1214)
* fix test breakage from colliding PRs landing too quickly (#1220)Alon Zakai2017-10-101-24/+15
|
* fix a dce fuzz bug where if changed to unreachable but didn't propagate that ↵Alon Zakai2017-10-102-19/+60
| | | | effect up. also add set_global support in dce (#1218)
* Fuzzer: create and use globals in fuzz programs (#1217)Alon Zakai2017-10-101-368/+930
|
* fix wasm-builder set_global creation - we must call finalize, as the value ↵Alon Zakai2017-10-102-0/+82
| | | | may be unreachable (#1216)
* optimize helper funcs (like i32-div) if created in asm2wasm, so they are ↵Alon Zakai2017-10-047-1/+110
| | | | consistently handled regardless of whether we optimize in parallel or not (#1208)
* Flattening rewrite (#1201)Alon Zakai2017-10-0317-1702/+4212
| | | | | | | | | | | | | | | | | | | | Rename flatten-control-flow to flatten, which now flattens everything, not just control flow, so e.g. (i32.add (call $x) (call $y) ) ==> (block (set_local $temp_x (call $x)) (set_local $temp_y (call $y)) (i32.add (get_local $x) (get_local $y) ) ) This uses more locals than before, but is much simpler and avoids a bunch of corner cases and fuzz bugs the old one hit. We can optimize later if necessary.
* Share trap mode between asm2wasm and s2wasm (#1168)jgravelle-google2017-10-0216-62/+1564
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extract Asm2WasmBuilder::TrapMode to shared FloatTrapMode * Extract makeTrappingI32Binary * Extract makeTrappingI64Binary * Extract asm2wasm test script into scripts/test/asm2wasm.py This matches s2wasm.py, and makes iterating on asm2wasm slightly faster. * Simplify callsites with an arg struct * Combine func adding across i32 and i64 * Support f32-to-int in asm2wasm * Add BinaryenTrapMode pass, run pass from s2wasm * BinaryenTrapMode pass takes trap context as a parameter * Pass fully supports non-trapping binary ops * Defer adding functions until after iteration (hackily) * Update asm2wasm to work with deferred function adding, rebuild tests * Extract makeTrappingFloatToInt32 * Extract makeTrappingFloatToInt64 * Add unary conversions to trap pass * Add functions in the pass itself * Set s2wasm trap mode with command-line arguments * Print BINARYEN_PASS_DEBUG state when testing * Get asm2wasm using the BinaryenTrapMode pass instead of handling it inline * Also handle f32 to int in asm2wasm * Make BinaryenTrapMode only need a FloatTrapMode from the caller * Just pass the current binary Expression directly * Combine makeTrappingI32Binary with makeTrappingI64Binary * Pass Unary expr to makeTrappingFloatToInt32 * Unify makeTrappingFloatToInt32 & 64 * Move makeTrapping* functions inside BinaryenTrapMode, make addedFunctions non-static * Remove FloatTrapContext * Minor cleanups * Extract some smaller subfunctions * Emit name switch/casing, rename is32Bit to isI64 for consistency * Rename BinaryenTrapMode to FloatTrap, make trap mode a nested enum * Add some comments explaining why FloatTrap is non-parallel * Rename addedFunctions to generatedFunctions for precision * Rename move and split float-clamp.h to passes/FloatTrap.(h|cpp) * Use builder instead of allocator * Instantiate trap handling passes via the pass manager * Move passes/FloatTrap.h to ast/trapping.h * Add helper function to add trap-handling passes * Add trap mode pass tests * Rename FloatTrap.cpp to TrapMode.cpp * Add s2wasm trap mode tests. Force float->int conversion to be signed * Add trapping_sint_div_s test to unit.asm.js * Fix flake8 issues with test scripts * Update pass description comment * Extract building functions methods * Make generate functions into top-level functions * Add GeneratedTrappingFunctions class to manage function/import additions * Move ensure/makeTrapping functions outside class scope * Use GeneratedTrappingFunctions to add immediately in asm2wasm mode * Remove trapping_sint_div_s test We only added it to test that trapping divisions would get constant-folded at the correct time. Now that we're not changing the timing of trapping modes, the test is unneeded (and problematic). * Review feedback, add validator/*.wasm to .gitignore * Add support for unsigned float-to-int conversion * Use opcode directly instead of bools * Update s2wasm clamp test for unsigned ftoi
* fix regression from 45d88e3ef5f895b2fde77e3588f84d66e67bdd88 - left may not ↵Alon Zakai2017-10-022-0/+44
| | | | 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 Zakai2017-10-022-0/+50
| | | | combining added constants (#1206)
* fix ExpressionAnalyzer::equals on consts, they need to be bitwise equal, ↵Alon Zakai2017-09-272-0/+61
| | | | i.e., 0 != -0
* fuzzing improvements:Alon Zakai2017-09-271-779/+395
| | | | | | | | * randomize initial memory * low chance to have tiny blocks * decent chance to have a branch back to the loop top
* fix dce bug with not updating the parent when turning a node unreachable (#1198)Alon Zakai2017-09-252-0/+102
|
* wasm2asm fixes for coercion on rotl/rotr/ctz/popcnt calls, and refactor the ↵Alon Zakai2017-09-231-4/+4
| | | | name of constants to include the WASM_ prefix so as not to collide with constants for the unprefixed values (#1199)
* Refactor i64 lowering to use RAII temp vars (#1177)Thomas Lively2017-09-231-38/+69
| | | | | | * Refactor i64 lowering to use RAII temp vars * Always generate trampoline blocks for Switch lowering
* when we re-finalize a function body, we may have changed it from unreachable ↵Alon Zakai2017-09-222-0/+30
| | | | to none. that is bad if the function has a return value, as unreachable was ok but none is not. in that case, we must add an unreachable (#1193)
* Update text syntax for shared memory limits (#1197)Derek Schuff2017-09-2229-35/+26
| | | | Following WebAssembly/threads#58 e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
* remove implicit fallthroughs (#1194) (#1196)Jeremy Day2017-09-201-700/+587
|
* Expressions should not appear twice in the ast (#1191)Alon Zakai2017-09-182-245/+279
|
* Add missing finalize() call to C API for call_indirect (#1184)Sergey Pepyakin2017-09-142-0/+24
|
* Avoid new blocks in binary reading/writing (#1165)Alon Zakai2017-09-1237-2573/+2251
| | | | | | * don't emit a toplevel block if we don't need to, as in wasm it is a list context * don't create unnecessary blocks in wasm reading
* precompute-propagate pass (#1179)Alon Zakai2017-09-1216-638/+1064
| | | | | | | Implements #1172: this adds a variant of precompute, "precompute-propagate", which also does constant propagation. Precompute by itself just runs the interpreter on each expression and sees if it is in fact a constant; precompute-propagate also looks at the graph of connections between get and set locals, and propagates those constant values. This helps with cases as noticed in #1168 - while in most cases LLVM will do this already, it's important when inlining, e.g. inlining of the clamping math functions. This new pass is run when inlining, and otherwise only in -O3/-Oz, as it does increase compilation time noticeably if run on everything (and for almost no benefit if LLVM has run). Most of the code here is just refactoring out from the ssa pass the get/set graph computation, so it can now be used by both the ssa pass and precompute-propagate.
* Const hoisting (#1176)Alon Zakai2017-09-122-0/+831
| | | A pass that hoists repeating constants to a local, and replaces their uses with a get of that local. This can reduce binary size, but can also *increase* gzip size, so it's mostly for experimentation and not used by default.
* asm2wasm atomics (#1171)Alon Zakai2017-09-117-0/+716
| | | | | | | | | | * translate asm.js atomics into wasm atomics * fix wasm-builder atomic load emitting, the alignment is the loaded size, not the output size * don't require code for each node type in vaccuum, for non-mentioned nodes, assume we can't optimize them out * support atomics in hashing, comparing, and copying
* Merge pull request #1175 from WebAssembly/fuzzAlon Zakai2017-09-105-1003/+817
|\ | | | | Fuzzer improvements + fixes
| * code-folding must propagate types when it optimizes somethingAlon Zakai2017-09-092-0/+47
| |
| * more special constants classes in fuzzingAlon Zakai2017-09-061-779/+642
| |
| * when if arms are identical, merging them may change the type of the if, if ↵Alon Zakai2017-09-062-0/+55
| | | | | | | | it has a forced type
| * initial call_indirect support in ttf modeAlon Zakai2017-09-061-1007/+856
| |
* | Add support for sign-extension operators from threading proposal (#1167)Derek Schuff2017-09-064-0/+117
|/ | | 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 Zakai2017-09-0531-121/+378
| | | | | | | | * 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.
* wasm-reduce tool (#1139)Alon Zakai2017-09-018-0/+114
| | | Reduce an interesting wasm to a smaller still interesting wasm. This takes an arbitrary command to run, and reduces the wasm as much as it can while keeping the behavior of that command fixed. This can be used to reduce compiler bugs in an arbitrary VM, etc.
* i64 to i32 lowering for wasm2asm (#1134)Thomas Lively2017-09-0111-72/+52034
|
* Update test/torture-s (#1155)Sam Clegg2017-08-301239-49390/+51338
| | | | The update was taken directly from the wasm waterfall: - https://wasm-stat.us/builders/linux/builds/23620
* Merge pull request #1154 from WebAssembly/fuzzAlon Zakai2017-08-285-1014/+1020
|\ | | | | Fuzz fixes