| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
The option keeps running the passes (that we were told to run) in cycles until we converge in terms of the binary size, that is, keep optimizing until we can't shrink any more.
Also fix a --metrics bug this uncovered: we can't expect the Metrics object to still be around if running passes later in another PassRunner.
|
|
|
|
|
| |
Report the offset with the error.
Also fix a compiler warning about comparing signed/unsigned types in the LEB code.
|
|
|
|
| |
makes loading large wasm files more than twice as fast (#1496)
|
|
|
| |
The & on the type is the proper convention.
|
|
|
|
|
|
|
|
|
| |
This optimizes the situation described in #1331. Namely, when x is copied into y, then on subsequent gets of x we could use y instead, and vice versa, as their value is equal. Specifically, this seems to get rid of the definite overlap in the live ranges of x and y, as removing it allows coalesce-locals to merge them. The pass therefore does nothing if the live range of y ends there anyhow.
The danger here is that we may extend the live range so that it causes more conflicts with other things, so this is a heuristic, but I've tested it on every codebase I can find and it always produces a net win, even on one I saw a 0.4% reduction of code size, which surprised me.
This is a fairly slow pass, because it uses LocalGraph which isn't much optimized. This PR includes a minor optimization for it, but we should rewrite it. Meanwhile this is just enabled in -O3 and -Oz.
This PR also includes some fuzzing improvements, to better test stuff like this.
|
|
|
|
| |
* add fuzz-pass option, which picks random passes to fuzz in each wasm-opt invocation
|
|
|
| |
Do not print the entire and possibly very large module when validation fails. Leave printing to tools using the validator, instead of always doing it in the validator where it can't be overridden.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This enum describes which wasm features the IR is expected to include. The
validator should reject operations which require excluded features, and passes
should avoid producing IR which requires excluded features.
This makes it easier to catch possible errors in Binaryen producers (e.g.
emscripten). Asm2wasm has a flag to enable or disable atomics. Other
tools currently just accept all features (as, dis and opt are just for
inspecting or modifying existing modules, so it would be annoying to have to use
flags with those tools and I expect the risk of accidentally introducing
atomics to be low).
|
|
|
|
|
|
|
|
| |
* avoid returning a PassRunner just for OptimizationOptions, it would need a more careful design with a copy constructor. instead, just simplify the API to do the thing we need, which is run the passes
* disallow copy constructor
* delete copy operator too
|
|
|
|
| |
for now this is linux-only as it uses popen etc.
|
|
|
|
|
|
| |
This adds a new method of fuzzing, "translate to fuzz" which means we consider the input to be a stream of data that we translate into a valid wasm module. It's sort of like a random seed for a process that creates a random wasm module. By using the input that way, we can explore the space of valid wasm modules quickly, and it makes afl-fuzz integration easy.
Also adds a "fuzz binary" option which is similar to "fuzz execution". It makes wasm-opt not only execute the code before and after opts, but also write to binary and read from it, helping to fuzz the binary format.
|
| |
|
| |
|
|
|
|
| |
* refactor optimization opts helper code to a class
|
|
|
|
| |
before and after optimizations are run, checking for changes. this can be used when fuzzing
|
|
|
|
|
|
|
|
|
|
| |
* properly catch a bunch of possible parse errors, found by afl-fuzz
* clean up wasm-interpreter, use WASM_UNREACHABLE instead of abort
* detect duplicate names in function names section
* detect duplicate export names
|
|
|
|
|
|
| |
* support -g in wasm-opt, which makes it easier to upgrade binaries for bustage
* upgrade binaries in test/merge to new names section format
|
|
|
|
|
| |
* Added ModuleReader/Writer classes that support text and binary I/O
* Use them in wasm-opt and asm2wasm
|
|
|
|
| |
And use them in wasm-opt and asm2wasm consistently and uniformly.
|
|
|
|
| |
* add PassOptions structure, and use it for new -Os param to wasm-opt
|
| |
|
|
tests
|