diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-21 12:02:52 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-06-21 12:02:52 -0700 |
commit | 36924330b0d0a67bd5894bb91140e8131e396cd7 (patch) | |
tree | 5140899245b1d7913431cfd1bd821300152cd86f /tools/eliminator | |
parent | 4654f7b59b99d5b3dcddc0fce9938d7e9f4601e0 (diff) |
do not eliminate loop vars when there is a shared helper
Diffstat (limited to 'tools/eliminator')
-rw-r--r-- | tools/eliminator/asm-eliminator-test-output.js | 13 | ||||
-rw-r--r-- | tools/eliminator/asm-eliminator-test.js | 15 |
2 files changed, 27 insertions, 1 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js index 2ce77b78..358a83df 100644 --- a/tools/eliminator/asm-eliminator-test-output.js +++ b/tools/eliminator/asm-eliminator-test-output.js @@ -5049,6 +5049,19 @@ function looop7() { HEAP32[$old_0_i107_i >> 2] = HEAP32[$696 >> 2] | 0; while (1) {} } +function looop8() { + var i = 0, j = 0, a = 0; + while (1) { + do_it(i, j); + a = i + j | 0; + if (condition(helper)) { + break; + } else { + i = a; + j = a; + } + } +} function multiloop($n_0, $35) { $n_0 = $n_0 | 0; $35 = $35 | 0; diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js index f45f082b..d082f70a 100644 --- a/tools/eliminator/asm-eliminator-test.js +++ b/tools/eliminator/asm-eliminator-test.js @@ -6775,6 +6775,19 @@ function looop7() { while (1) { } } +function looop8() { + var i = 0, j = 0, a = 0; + while (1) { + do_it(i, j); + a = (i + j)|0; + if (condition(helper)) { + break; + } else { + i = a; // helper used twice! + j = a; + } + } +} function multiloop($n_0, $35) { $n_0 = $n_0 | 0; $35 = $35 | 0; @@ -6838,5 +6851,5 @@ function tempDouble2($46, $14, $28, $42, $20, $32, $45) { HEAP32[$45 + 4 >> 2] = $_sroa_06_0_insert_insert$1; HEAP32[$45 + 8 >> 2] = $_sroa_06_0_insert_insert$1; } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion", "tempDouble", "_org_apache_harmony_luni_util_NumberConverter_freeFormat__", "__ZN23b2EdgeAndPolygonContact8EvaluateEP10b2ManifoldRK11b2TransformS4_", "_java_nio_charset_Charset_forNameInternal___java_lang_String", "looop2", "looop3", "looop4", "looop5", "looop6", "looop7", "multiloop", "multiloop2", "tempDouble2"] +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion", "tempDouble", "_org_apache_harmony_luni_util_NumberConverter_freeFormat__", "__ZN23b2EdgeAndPolygonContact8EvaluateEP10b2ManifoldRK11b2TransformS4_", "_java_nio_charset_Charset_forNameInternal___java_lang_String", "looop2", "looop3", "looop4", "looop5", "looop6", "looop7", "looop8", "multiloop", "multiloop2", "tempDouble2"] |