Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/asm2wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,10 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
passRunner.add("remove-unused-brs");
passRunner.add("optimize-instructions");
passRunner.add("post-emscripten");
passRunner.add("dce"); // make sure to not emit unreachable code
}
// make sure to not emit unreachable code at all, even in -O0, as wasm rules for it are complex
// and changing.
passRunner.add("dce");
passRunner.run();

// apply memory growth, if relevant
Expand Down
21 changes: 0 additions & 21 deletions test/emcc_hello_world.fromasm.imprecise.no-opts
Original file line number Diff line number Diff line change
Expand Up @@ -5982,7 +5982,6 @@
(i32.const 9)
)
(br $label$break$L9)
(br $switch)
)
)
(block
Expand All @@ -5993,7 +5992,6 @@
(get_local $$incdec$ptr169274)
)
(br $label$break$L9)
(br $switch)
)
)
(nop)
Expand Down Expand Up @@ -7881,7 +7879,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand All @@ -7907,7 +7904,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -7967,7 +7963,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -7999,7 +7994,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -8031,7 +8025,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand All @@ -8057,7 +8050,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -8117,7 +8109,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand All @@ -8136,7 +8127,6 @@
(br $label$continue$L1)
)
)
(br $switch17)
)
)
(block
Expand Down Expand Up @@ -13145,7 +13135,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch17)
)
)
(block
Expand Down Expand Up @@ -14766,7 +14755,6 @@
(get_local $$6)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -14883,7 +14871,6 @@
(get_local $$15)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -14985,7 +14972,6 @@
(i32.const 0)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15107,7 +15093,6 @@
(get_local $$42)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15239,7 +15224,6 @@
(get_local $$56)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15347,7 +15331,6 @@
(i32.const 0)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15479,7 +15462,6 @@
(get_local $$81)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15587,7 +15569,6 @@
(i32.const 0)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15670,7 +15651,6 @@
(get_local $$103)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15753,7 +15733,6 @@
(get_local $$110)
)
(br $label$break$L1)
(br $switch)
)
)
(br $label$break$L1)
Expand Down
21 changes: 0 additions & 21 deletions test/emcc_hello_world.fromasm.no-opts
Original file line number Diff line number Diff line change
Expand Up @@ -5988,7 +5988,6 @@
(i32.const 9)
)
(br $label$break$L9)
(br $switch)
)
)
(block
Expand All @@ -5999,7 +5998,6 @@
(get_local $$incdec$ptr169274)
)
(br $label$break$L9)
(br $switch)
)
)
(nop)
Expand Down Expand Up @@ -7887,7 +7885,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand All @@ -7913,7 +7910,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -7973,7 +7969,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -8005,7 +8000,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -8037,7 +8031,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand All @@ -8063,7 +8056,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand Down Expand Up @@ -8123,7 +8115,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch18)
)
)
(block
Expand All @@ -8142,7 +8133,6 @@
(br $label$continue$L1)
)
)
(br $switch17)
)
)
(block
Expand Down Expand Up @@ -13151,7 +13141,6 @@
(get_local $$l10n$3)
)
(br $label$continue$L1)
(br $switch17)
)
)
(block
Expand Down Expand Up @@ -14772,7 +14761,6 @@
(get_local $$6)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -14889,7 +14877,6 @@
(get_local $$15)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -14991,7 +14978,6 @@
(i32.const 0)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15113,7 +15099,6 @@
(get_local $$42)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15245,7 +15230,6 @@
(get_local $$56)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15353,7 +15337,6 @@
(i32.const 0)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15485,7 +15468,6 @@
(get_local $$81)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15593,7 +15575,6 @@
(i32.const 0)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15676,7 +15657,6 @@
(get_local $$103)
)
(br $label$break$L1)
(br $switch)
)
)
(block
Expand Down Expand Up @@ -15759,7 +15739,6 @@
(get_local $$110)
)
(br $label$break$L1)
(br $switch)
)
)
(br $label$break$L1)
Expand Down
3 changes: 0 additions & 3 deletions test/two_sides.fromasm.imprecise.no-opts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,5 @@
)
)
)
(return
(i32.const 0)
)
)
)
3 changes: 0 additions & 3 deletions test/two_sides.fromasm.no-opts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,5 @@
)
)
)
(return
(i32.const 0)
)
)
)
Loading