diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-20 11:27:25 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-20 11:27:25 -0800 |
commit | 2d5f34d1504a3e9c90780efd4194a36da5296718 (patch) | |
tree | cbc509fb9d7570ab5ff57d3cffe7f53e80a5cfb9 | |
parent | 63abd230948eb2ce11f65acbfef63f8ce67f53b5 (diff) |
simplify ir for fastcomp after the autodebugger runs
-rwxr-xr-x | emcc | 10 | ||||
-rwxr-xr-x | tests/fuzz/test.sh | 2 |
2 files changed, 9 insertions, 3 deletions
@@ -1685,10 +1685,10 @@ try: link_opts += shared.Building.get_safe_internalize() + ['-globaldce'] # Simplify LLVM bitcode for fastcomp - if os.environ.get('EMCC_FAST_COMPILER'): + if os.environ.get('EMCC_FAST_COMPILER') and not AUTODEBUG: link_opts += ['-pnacl-abi-simplify-preopt', '-pnacl-abi-simplify-postopt'] - if not save_bc and not os.environ.get('EMCC_FAST_COMPILER') and not AUTODEBUG: + if (not save_bc and not os.environ.get('EMCC_FAST_COMPILER')) or AUTODEBUG: # let llvm opt directly emit ll, to skip writing and reading all the bitcode link_opts += ['-S'] shared.Building.llvm_opt(final, link_opts, final + '.link.ll') @@ -1715,6 +1715,12 @@ try: final += '.ad.ll' if DEBUG: save_intermediate('autodebug', 'll') + # Simplify bitcode after autodebug + if os.environ.get('EMCC_FAST_COMPILER') and AUTODEBUG: + shared.Building.llvm_opt(final, ['-pnacl-abi-simplify-preopt', '-pnacl-abi-simplify-postopt'], final + '.adsimp.bc') + final += '.adsimp.bc' + if DEBUG: save_intermediate('adsimp', 'bc') + # Emscripten logging.debug('LLVM => JS') extra_args = [] if not js_libraries else ['--libraries', ','.join(map(os.path.abspath, js_libraries))] diff --git a/tests/fuzz/test.sh b/tests/fuzz/test.sh index 60815c9f..99dedd97 100755 --- a/tests/fuzz/test.sh +++ b/tests/fuzz/test.sh @@ -14,7 +14,7 @@ gcc -O1 $1 -I/home/alon/Dev/csmith/runtime mozjs a.out.js echo "2" gcc -O2 $1 -I/home/alon/Dev/csmith/runtime -~/Dev/emscripten/emcc -O2 $1 -I/home/alon/Dev/csmith/runtime +~/Dev/emscripten/emcc -O2 -g2 $1 -I/home/alon/Dev/csmith/runtime ./a.out mozjs a.out.js |