aboutsummaryrefslogtreecommitdiff
path: root/tools/eliminator
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-07 10:02:56 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-07 10:09:12 -0700
commit523ed62b3c68ef4dc04fb2918ae8b1b2f8e2bce1 (patch)
treef57f2e9f26b67009c1b172a96d528085fd5f13cd /tools/eliminator
parent265dd5a4e28ebd280dafb5febca1b556abc473e8 (diff)
optimize multiple loop variables together
Diffstat (limited to 'tools/eliminator')
-rw-r--r--tools/eliminator/asm-eliminator-test-output.js45
-rw-r--r--tools/eliminator/asm-eliminator-test.js50
2 files changed, 94 insertions, 1 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js
index a7eebe25..52c91ce1 100644
--- a/tools/eliminator/asm-eliminator-test-output.js
+++ b/tools/eliminator/asm-eliminator-test-output.js
@@ -5049,4 +5049,49 @@ function looop7() {
HEAP32[$old_0_i107_i >> 2] = HEAP32[$696 >> 2] | 0;
while (1) {}
}
+function multiloop($n_0, $35) {
+ $n_0 = $n_0 | 0;
+ $35 = $35 | 0;
+ var $p_0 = 0, $41 = 0;
+ $n_0 = $35;
+ $p_0 = (HEAP32[$15 >> 2] | 0) + ($35 << 1) | 0;
+ while (1) {
+ $p_0 = $p_0 - 2 | 0;
+ $41 = HEAPU16[$p_0 >> 1] | 0;
+ if ($41 >>> 0 < $2 >>> 0) {
+ $_off0 = 0;
+ } else {
+ $_off0 = $41 - $2 & 65535;
+ }
+ HEAP16[$p_0 >> 1] = $_off0;
+ $n_0 = $n_0 - 1 | 0;
+ if (($n_0 | 0) == 0) {
+ break;
+ }
+ }
+}
+function multiloop2($n_0, $35) {
+ $n_0 = $n_0 | 0;
+ $35 = $35 | 0;
+ var $p_0 = 0, $39 = 0, $41 = 0, $46 = 0;
+ $n_0 = $35;
+ $p_0 = (HEAP32[$15 >> 2] | 0) + ($35 << 1) | 0;
+ while (1) {
+ $39 = $p_0 - 2 | 0;
+ $41 = HEAPU16[$39 >> 1] | 0;
+ if ($41 >>> 0 < $2 >>> 0) {
+ $_off0 = 0;
+ } else {
+ $_off0 = $41 - $2 & 65535;
+ }
+ HEAP16[$39 >> 1] = $p_0;
+ $46 = $n_0 - 1 | 0;
+ if (($46 | 0) == 0) {
+ break;
+ } else {
+ $n_0 = $46;
+ $p_0 = $39;
+ }
+ }
+}
diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js
index 22b6ddec..e01a89ea 100644
--- a/tools/eliminator/asm-eliminator-test.js
+++ b/tools/eliminator/asm-eliminator-test.js
@@ -6775,5 +6775,53 @@ function looop7() {
while (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"]
+function multiloop($n_0, $35) {
+ $n_0 = $n_0 | 0;
+ $35 = $35 | 0;
+ var $p_0 = 0, $39 = 0, $41 = 0, $46 = 0;
+ $n_0 = $35;
+ $p_0 = (HEAP32[$15 >> 2] | 0) + ($35 << 1) | 0;
+ while (1) {
+ $39 = $p_0 - 2 | 0;
+ $41 = HEAPU16[$39 >> 1] | 0;
+ if ($41 >>> 0 < $2 >>> 0) {
+ $_off0 = 0;
+ } else {
+ $_off0 = $41 - $2 & 65535;
+ }
+ HEAP16[$39 >> 1] = $_off0;
+ $46 = $n_0 - 1 | 0;
+ if (($46 | 0) == 0) {
+ break;
+ } else {
+ $n_0 = $46;
+ $p_0 = $39;
+ }
+ }
+}
+function multiloop2($n_0, $35) {
+ $n_0 = $n_0 | 0;
+ $35 = $35 | 0;
+ var $p_0 = 0, $39 = 0, $41 = 0, $46 = 0;
+ $n_0 = $35;
+ $p_0 = (HEAP32[$15 >> 2] | 0) + ($35 << 1) | 0;
+ while (1) {
+ $39 = $p_0 - 2 | 0;
+ $41 = HEAPU16[$39 >> 1] | 0;
+ if ($41 >>> 0 < $2 >>> 0) {
+ $_off0 = 0;
+ } else {
+ $_off0 = $41 - $2 & 65535;
+ }
+ HEAP16[$39 >> 1] = $p_0; // cannot optimize one, so none
+ $46 = $n_0 - 1 | 0;
+ if (($46 | 0) == 0) {
+ break;
+ } else {
+ $n_0 = $46;
+ $p_0 = $39;
+ }
+ }
+}
+// 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"]