diff --git a/wasm/test/bench.sh b/wasm/test/bench.sh index 4a1e3b065..ed15666ba 100755 --- a/wasm/test/bench.sh +++ b/wasm/test/bench.sh @@ -20,7 +20,7 @@ bench() { ../../ocamlopt $UNSAFE -O3 ./${2}.ml > /dev/null # optimize wasocaml code cat a.out.wat | grep -v "^ (export" > a.out.noexport.wat - WASMOPT="wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-tail-call --enable-nontrapping-float-to-int --traps-never-happen -O3 --abstract-type-refining --cfp --coalesce-locals --closed-world --type-ssa --gufa-optimizing --type-merging --strip-debug --strip-dwarf --strip-producers --strip-target-features --type-refining --unsubtyping --vacuum --tuple-optimization --ssa --simplify-locals --simplify-globals-optimizing --signature-refining --signature-pruning --roundtrip --reorder-locals --reorder-globals --reorder-functions --remove-unused-types --remove-unused-names --remove-unused-module-elements --remove-unused-brs --remove-memory --precompute --optimize-instructions --optimize-casts --once-reduction --monomorphize --minimize-rec-groups --merge-similar-functions --merge-locals --merge-blocks --local-subtyping --local-cse --licm --intrinsic-lowering --inlining-optimizing --heap-store-optimization --gto --gsi --global-refining --duplicate-import-elimination --duplicate-function-elimination --directize --dce --dae-optimizing" + WASMOPT="wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-tail-call --enable-nontrapping-float-to-int --traps-never-happen -O3 --abstract-type-refining --cfp --coalesce-locals --closed-world --type-ssa --gufa-optimizing --type-merging --strip-debug --strip-dwarf --strip-producers --strip-target-features --type-refining --unsubtyping --vacuum --tuple-optimization --ssa --simplify-locals --simplify-globals-optimizing --signature-refining --signature-pruning --roundtrip --reorder-locals --reorder-globals --reorder-functions --remove-unused-types --remove-unused-names --remove-unused-module-elements --remove-unused-brs --remove-memory --precompute --optimize-instructions --optimize-casts --once-reduction --monomorphize --minimize-rec-groups --merge-similar-functions --merge-locals --merge-blocks --local-subtyping --local-cse --licm --intrinsic-lowering --inlining-optimizing --heap-store-optimization --gto --gsi --global-refining --duplicate-import-elimination --duplicate-function-elimination --directize --dce --dae-optimizing -O3 -O3 --gufa -O3 -O3 --gufa -O3 -O3 --converge --abstract-type-refining --cfp --coalesce-locals --closed-world --type-ssa --gufa-optimizing --type-merging --strip-debug --strip-dwarf --strip-producers --strip-target-features --type-refining --unsubtyping --vacuum --tuple-optimization --ssa --simplify-locals --simplify-globals-optimizing --signature-refining --signature-pruning --roundtrip --reorder-locals --reorder-globals --reorder-functions --remove-unused-types --remove-unused-names --remove-unused-module-elements --remove-unused-brs --remove-memory --precompute --optimize-instructions --optimize-casts --once-reduction --monomorphize --minimize-rec-groups --merge-similar-functions --merge-locals --merge-blocks --local-subtyping --local-cse --licm --intrinsic-lowering --inlining-optimizing --heap-store-optimization --gto --gsi --global-refining --duplicate-import-elimination --duplicate-function-elimination --directize --dce --dae-optimizing -O3 -O3 --gufa -O3 -O3 -O3 -O3 -O3 -O3 -O3" # TODO: try --flatten ; --rereloop ; --precompute-propagate ; --dfo $WASMOPT -o a.out.wasm a.out.noexport.wat # compile bytecode @@ -42,14 +42,11 @@ bench() { } -#bench "Almabench" "almabench" # global init must have correct type -#bench "Boyer" "boyer" # unreachable -#bench "Boyer no exceptions" "boyer_no_exc" # unreachable -#bench "Fast Fourier Transform" "fft" # unreachable +#bench "Boyer" "boyer" # unreachable: caml_compare_blocks +#bench "Boyer no exceptions" "boyer_no_exc" # unreachable: caml_compare_blocks #bench "Hamming" "hamming" # missing value let-rec #bench "Ray-Trace" "raytrace" # global init must have correct type -#bench "Splay Tree" "splay" # wrong result - +#bench "Splay Tree" "splay" # string_of_float is not supported bench "Binary Decision Diagram" "bdd" bench "Binary Trees" "binary_trees" # seems wrong if we uncomment the check print in loop_depths ? @@ -64,3 +61,8 @@ bench "Quicksort" "quicksort" bench "Soli" "soli" bench "Takc" "takc" bench "Taku" "taku" + +# bench "Almabench" "almabench" # requires --disable-flat-float-array, otherwise: global init must have correct type +# bench "Fast Fourier Transform" "fft" # requires --disable-flat-float-array illegal cast on float array, see comment in file + +# bench "Pascal" "pascal" # not part of the wsoo bench suite diff --git a/wasm/test/test.sh b/wasm/test/test.sh index c5267d9f9..8577b8dac 100755 --- a/wasm/test/test.sh +++ b/wasm/test/test.sh @@ -22,10 +22,10 @@ bench_wasocaml_opt() { echo -n " Wasocaml + wasm-opt (node): " ../../ocamlopt $UNSAFE -O3 ./${2}.ml > /dev/null cat a.out.wat | grep -v "^ (export" > a.out.noexport.wat - WASMOPT="wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-tail-call --enable-nontrapping-float-to-int --traps-never-happen -O3 --abstract-type-refining --cfp --coalesce-locals --closed-world --type-ssa --gufa-optimizing --type-merging --strip-debug --strip-dwarf --strip-producers --strip-target-features --type-refining --unsubtyping --vacuum --tuple-optimization --ssa --simplify-locals --simplify-globals-optimizing --signature-refining --signature-pruning --roundtrip --reorder-locals --reorder-globals --reorder-functions --remove-unused-types --remove-unused-names --remove-unused-module-elements --remove-unused-brs --remove-memory --precompute --optimize-instructions --optimize-casts --once-reduction --monomorphize --minimize-rec-groups --merge-similar-functions --merge-locals --merge-blocks --local-subtyping --local-cse --licm --intrinsic-lowering --inlining-optimizing --heap-store-optimization --gto --gsi --global-refining --duplicate-import-elimination --duplicate-function-elimination --directize --dce --dae-optimizing" + WASMOPT="wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-tail-call --enable-nontrapping-float-to-int --traps-never-happen -O3 --abstract-type-refining --cfp --coalesce-locals --closed-world --type-ssa --gufa-optimizing --type-merging --strip-debug --strip-dwarf --strip-producers --strip-target-features --type-refining --unsubtyping --vacuum --tuple-optimization --ssa --simplify-locals --simplify-globals-optimizing --signature-refining --signature-pruning --roundtrip --reorder-locals --reorder-globals --reorder-functions --remove-unused-types --remove-unused-names --remove-unused-module-elements --remove-unused-brs --remove-memory --precompute --optimize-instructions --optimize-casts --once-reduction --monomorphize --minimize-rec-groups --merge-similar-functions --merge-locals --merge-blocks --local-subtyping --local-cse --licm --intrinsic-lowering --inlining-optimizing --heap-store-optimization --gto --gsi --global-refining --duplicate-import-elimination --duplicate-function-elimination --directize --dce --dae-optimizing -O3 -O3 --gufa -O3 -O3 --gufa -O3 -O3 --converge --abstract-type-refining --cfp --coalesce-locals --closed-world --type-ssa --gufa-optimizing --type-merging --strip-debug --strip-dwarf --strip-producers --strip-target-features --type-refining --unsubtyping --vacuum --tuple-optimization --ssa --simplify-locals --simplify-globals-optimizing --signature-refining --signature-pruning --roundtrip --reorder-locals --reorder-globals --reorder-functions --remove-unused-types --remove-unused-names --remove-unused-module-elements --remove-unused-brs --remove-memory --precompute --optimize-instructions --optimize-casts --once-reduction --monomorphize --minimize-rec-groups --merge-similar-functions --merge-locals --merge-blocks --local-subtyping --local-cse --licm --intrinsic-lowering --inlining-optimizing --heap-store-optimization --gto --gsi --global-refining --duplicate-import-elimination --duplicate-function-elimination --directize --dce --dae-optimizing -O3 -O3 --gufa -O3 -O3 -O3 -O3 -O3 -O3 -O3" # TODO: try --flatten ; --rereloop ; --precompute-propagate ; --dfo $WASMOPT -o a.out.wasm a.out.noexport.wat - $WASMOPT -S -o a.out.wat a.out.wasm + $WASMOPT --print-stack-ir -o a.out.bis.wat a.out.wasm > a.out.wat time $NODE ./main_node.mjs > output_${2}_wasocaml_opt.txt diff output_${2}_ocaml_native.txt output_${2}_wasocaml_opt.txt } @@ -71,17 +71,14 @@ bench() { bench_wasocaml_opt "${1}" "${2}" #bench_wasocaml "${1}" "${2}" bench_wsoo "${1}" "${2}" - bench_jsoo "${1}" "${2}" - bench_bytecode "${1}" "${2}" + #bench_jsoo "${1}" "${2}" + #bench_bytecode "${1}" "${2}" echo "" } -#bench "Pascal" "pascal" -#bench "Almabench" "almabench" # global init must have correct type #bench "Boyer" "boyer" # unreachable: caml_compare_blocks #bench "Boyer no exceptions" "boyer_no_exc" # unreachable: caml_compare_blocks -#bench "Fast Fourier Transform" "fft" # illegal cast on float array, see comment in file #bench "Hamming" "hamming" # missing value let-rec #bench "Ray-Trace" "raytrace" # global init must have correct type #bench "Splay Tree" "splay" # string_of_float is not supported @@ -92,10 +89,15 @@ bench "Fibonacci" "fib" bench "Knuth-Bendix" "kb" bench "Knuth-Bendix (no exception)" "kb_no_exc" bench "Loop" "loop" -#bench "Nucleic" "nucleic" # wsoo crash on this one.. +bench "Nucleic" "nucleic" # wsoo crash on this one.. bench "Pfannkuchen" "fannkuch" bench "Pfannkuchen 2" "fannkuch2" bench "Quicksort" "quicksort" bench "Soli" "soli" bench "Takc" "takc" bench "Taku" "taku" + +# bench "Almabench" "almabench" # requires --disable-flat-float-array, otherwise: global init must have correct type +# bench "Fast Fourier Transform" "fft" # requires --disable-flat-float-array illegal cast on float array, see comment in file + +# bench "Pascal" "pascal" # not part of the wsoo bench suite