aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-asm-regs-harder.js
diff options
context:
space:
mode:
authorRyan Kelly <ryan@rfk.id.au>2014-05-20 15:17:18 +1000
committerRyan Kelly <ryan@rfk.id.au>2014-05-20 15:17:18 +1000
commit751756ddffdbdf8061b4b73ac6848c0a1f5e61b7 (patch)
treee843256a528a9c1abaeac19019af0a66fa7465b6 /tools/test-js-optimizer-asm-regs-harder.js
parent16d6cb35b4f1a78b1c435999f4081bdc0c566ac8 (diff)
Fix elimination of conditional expressions in registerizeHarder.
Previously, attempts to eliminate a side-effect-free conditional expression would corrupt internal block state, because the sub-nodes belong to a different block than the one containing the expression. This fixes the problem by not splitting side-effect free conditionals across multiple blocks.
Diffstat (limited to 'tools/test-js-optimizer-asm-regs-harder.js')
-rw-r--r--tools/test-js-optimizer-asm-regs-harder.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/test-js-optimizer-asm-regs-harder.js b/tools/test-js-optimizer-asm-regs-harder.js
index 0231a215..fa72aab8 100644
--- a/tools/test-js-optimizer-asm-regs-harder.js
+++ b/tools/test-js-optimizer-asm-regs-harder.js
@@ -149,5 +149,11 @@ function linkedVars() {
}
return outer1 + outer2;
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "_doit", "stackRestore", "switchey", "switchey2", "iffey", "labelledJump", "linkedVars']
+function deadCondExpr(input) {
+ input = input|0;
+ var dead = 0, temp = 0;
+ dead = (!input ? -1 : input)|0;
+ return temp|0;
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "_doit", "stackRestore", "switchey", "switchey2", "iffey", "labelledJump", "linkedVars", "deadCondExpr"]