| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
combining added constants (#1206)
|
|
|
|
|
|
| |
* don't use multiple threads in torture tests, which are parallel anyhow
* if we fail to create a thread, don't use multiple threads
|
|
|
| |
* optimize wasm reading: use a set of the breaks we've seen, don't rescan blocks to see if they have breaks to them
|
|
|
|
| |
i.e., 0 != -0
|
|
|
|
|
|
|
|
| |
* randomize initial memory
* low chance to have tiny blocks
* decent chance to have a branch back to the loop top
|
| |
|
|
|
|
| |
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
* Always generate trampoline blocks for Switch lowering
|
| |
|
|
|
|
| |
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)
|
|
|
|
| |
Following WebAssembly/threads#58
e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* Add missing prototypes for globals in binaryen-c.h
* Use int8_t for mutable_
|
| |
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Recent versions of clang turn on -Wdelete-non-virtual-dtor at our warning
level, which fires when deleting a non-final class that has virtual functions
but a non-virtual destructor. Pre-C++11 standard rule of thumb is to just always
have a virtual destructor if there are virtual functions, but C++11 final is
even better since it may allow for devirtualization optimizations.
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|\
| |
| | |
Fuzzer improvements + fixes
|
| | |
|
| | |
|
| |
| |
| |
| | |
it has a forced type
|
| | |
|
| |
| |
| | |
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).
|
|/
|
|
| |
validation that was from when we differentiated reachable from unreachable breaks (#1166)
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
| |
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.
|
| |
|
| |
|
|\
| |
| | |
Fuzz fixes
|
| | |
|
| | |
|
| | |
|
|/
|
| |
Adds --safe-heap which instruments the code to check heap loads and stores for validity (null pointer derefs, within range of valid sbrk memory, and alignment). Used in SAFE_HEAP in emscripten.
|
|
|
|
| |
with a value from the current state, not just set the global state as to whether we can flow or not (as it will be set later by other things)
|
|
|
|
| |
remove-unused-brs, as they are dead code anyhow, and it is pointless to work hard to handle the type changes
|
| |
|
|
|
|
| |
special handling to emit valid code
|
| |
|
|
|
|
| |
for now this is linux-only as it uses popen etc.
|
|
|
|
| |
etc. don't always return a constant, but may return the result of computation
|
|
|
|
| |
almost fails)
|
|
|
| |
According to spec at https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
|
|
|
|
| |
* Added BinaryenModulePrintAsmjs (using wasm2asm) + Module#emitAsmjs JS binding
|
|
|
|
|
|
|
|
| |
* run execution results on the same instance, so side effects of memory writes persist, which is the same as when we run the code in a js vm, so we can directly compare
* fuzz only exported functions, not things that opts might remove
* note results in fuzz-exec by export name
|
|
|
|
|
|
|
| |
* Improve inlining pass to inline single-use functions that are fairly small, which makes it useful for removing unnecessary global constructors from clang.
* Add an inlining-optimizing pass that also optimizes where it inlined, as new opportunities arise. enable that it by default in O2+
* In addition, in -O3+ also inline small functions with multiple uses. This helps a lot with things like safe-int-divide functions (where each int divide is replaced by a safe divide that won't trap). Inlining gets rid of around half of the overhead there.
|
|
|
| |
Ignoring unreachable code in wasm binaries lets us avoid corner cases with unstructured code in wasm binaries that is a poor fit for Binaryen's structured IR.
|