| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
Fixes #1161.
In popular OSS projects major parts of builds is usually triggered by pull requests. So I think it should be sufficient to disable build stage for pull requests and let them run only on master branch and release tags. This is IMO better than run them only periodically by cron.
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| | |
|
| |
| |
| |
| |
| | |
One could argue that they should go in separate files
but this seems like a good first step.
|
| |
| |
| | |
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.
|
| |
|
|
|
|
| |
This means you can do `rm -rf test/wasm-install` and have
it get redownloaded.
|
|
|
|
| |
The update was taken directly from the wasm waterfall:
- https://wasm-stat.us/builders/linux/builds/23620
|
| |
|
|
|
|
|
| |
Also, fix -l and -rpath lib directories so that it can be
run out-of-tree
|
| |
|
|\
| |
| | |
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.
|
|\
| |
| | |
Fuzzer improvements and some small fixes
|
| |
| |
| |
| | |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Translate assert_return invokes to asm
* Translate assert_trap tests to JS
* Enable wasm2asm tests
* Fix wasm2asm translation of store
* Update ubuntu nodejs in Travis
* Free JSPrinter buffer
* Use unique_ptr for Functions to prevent leaks
* Add tests for assert translation
|
|
|
|
| |
* emit optimal-size LEBs in section/subsection/function body sizes, instead of preallocating 5 bytes
|