diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-12 18:55:36 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-12 18:55:36 -0800 |
commit | 8f4c82a6d7b48e4754aed6e7ed20488774a83a4f (patch) | |
tree | 070263aa740ef55c9eb9ec6df6faecc79364dfd0 /tools/js-optimizer.js | |
parent | 524910b8d152bbd6a2aff719059f5a4ef0386126 (diff) |
do not try to eliminate phi variables, which are unsafe to be removed and the llvm optimizer will remove anyhow if unused
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index e6b945a2..c463970f 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1652,7 +1652,7 @@ function eliminate(ast, memSafe, asm) { for (var name in locals) { if (definitions[name] == 1 && uses[name] == 1) { potentials[name] = 1; - } else if (uses[name] == 0) { + } else if (uses[name] == 0 && (!definitions[name] || definitions[name] <= 1)) { // no uses, no def or 1 def (cannot operate on phis, and the llvm optimizer will remove unneeded phis anyhow) var hasSideEffects = false; if (values[name]) { traverse(values[name], function(node, type) { |