diff options
author | Alon Zakai <azakai@google.com> | 2020-04-28 09:51:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 09:51:14 -0700 |
commit | d8f9e9635ca7ca31d3dc02f3030c9fdaa453f967 (patch) | |
tree | bbd58efb78e0a709574bfecca9e6fdb881de7bae | |
parent | d9ec300d178d68f0a1dca587fa6f8f66e74acfae (diff) | |
download | binaryen-d8f9e9635ca7ca31d3dc02f3030c9fdaa453f967.tar.gz binaryen-d8f9e9635ca7ca31d3dc02f3030c9fdaa453f967.tar.bz2 binaryen-d8f9e9635ca7ca31d3dc02f3030c9fdaa453f967.zip |
Use --detect-features in wasm-reduce. Fixes #2813 (#2815)
-rwxr-xr-x | check.py | 6 | ||||
-rw-r--r-- | src/tools/wasm-reduce.cpp | 8 |
2 files changed, 5 insertions, 9 deletions
@@ -169,7 +169,7 @@ def run_wasm_reduce_tests(): print('..', os.path.basename(t)) # convert to wasm support.run_command(shared.WASM_AS + [t, '-o', 'a.wasm']) - support.run_command(shared.WASM_REDUCE + ['a.wasm', '--command=%s b.wasm --fuzz-exec -all' % shared.WASM_OPT[0], '-t', 'b.wasm', '-w', 'c.wasm', '--timeout=4']) + support.run_command(shared.WASM_REDUCE + ['a.wasm', '--command=%s b.wasm --fuzz-exec --detect-features ' % shared.WASM_OPT[0], '-t', 'b.wasm', '-w', 'c.wasm', '--timeout=4']) expected = t + '.txt' support.run_command(shared.WASM_DIS + ['c.wasm', '-o', 'a.wat']) with open('a.wat') as seen: @@ -180,9 +180,9 @@ def run_wasm_reduce_tests(): if 'fsanitize=thread' not in str(os.environ): print('\n[ checking wasm-reduce fuzz testcase ]\n') # TODO: re-enable multivalue once it is better optimized - support.run_command(shared.WASM_OPT + [os.path.join(shared.options.binaryen_test, 'signext.wast'), '-ttf', '-Os', '-o', 'a.wasm', '-all', '--disable-multivalue']) + support.run_command(shared.WASM_OPT + [os.path.join(shared.options.binaryen_test, 'signext.wast'), '-ttf', '-Os', '-o', 'a.wasm', '--detect-features', '--disable-multivalue']) before = os.stat('a.wasm').st_size - support.run_command(shared.WASM_REDUCE + ['a.wasm', '--command=%s b.wasm --fuzz-exec -all' % shared.WASM_OPT[0], '-t', 'b.wasm', '-w', 'c.wasm']) + support.run_command(shared.WASM_REDUCE + ['a.wasm', '--command=%s b.wasm --fuzz-exec --detect-features' % shared.WASM_OPT[0], '-t', 'b.wasm', '-w', 'c.wasm']) after = os.stat('c.wasm').st_size # This number is a custom threshold to check if we have shrunk the # output sufficiently diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 6e6762099..d55dab893 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -282,9 +282,7 @@ struct Reducer // compensated for), and without for (auto pass : passes) { std::string currCommand = Path::getBinaryenBinaryTool("wasm-opt") + " "; - // TODO(tlively): -all should be replaced with an option to use the - // existing feature set, once implemented. - currCommand += working + " -all -o " + test + " " + pass; + currCommand += working + " --detect-features -o " + test + " " + pass; if (debugInfo) { currCommand += " -g "; } @@ -1191,10 +1189,8 @@ int main(int argc, const char* argv[]) { "(read-written) binary\n"; { // read and write it - // TODO(tlively): -all should be replaced with an option to use the existing - // feature set, once implemented. auto cmd = Path::getBinaryenBinaryTool("wasm-opt") + " " + input + - " -all -o " + test; + " --detect-features -o " + test; if (!binary) { cmd += " -S"; } |