aboutsummaryrefslogtreecommitdiff
path: root/tools/eliminator/asm-eliminator-test-output.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-27 10:34:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-03-27 10:34:52 -0700
commit422d65dc0603ca7c856e82425adfeee01463d2b0 (patch)
tree9f18a36de2cdbb210af08b00ff281716f9a59e14 /tools/eliminator/asm-eliminator-test-output.js
parente01dac87dae70222db7b8c0a8f3301b368f8b67b (diff)
optimize away individual loop vars, even if we can't remove them all
Diffstat (limited to 'tools/eliminator/asm-eliminator-test-output.js')
-rw-r--r--tools/eliminator/asm-eliminator-test-output.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js
index e1bc83bf..a3873067 100644
--- a/tools/eliminator/asm-eliminator-test-output.js
+++ b/tools/eliminator/asm-eliminator-test-output.js
@@ -819,4 +819,42 @@ function selfAssign() {
}
return i1 & 16384 | 0;
}
+function elimOneLoopVar($argc, $argv) {
+ $argc = $argc | 0;
+ $argv = $argv | 0;
+ var $arg$0 = 0, $call10 = Math_fround(0), $curri$012 = 0, $inc = 0, $j$010 = 0, $ok$0 = 0, $primes$011 = 0, $retval$0 = 0, $vararg_buffer1 = 0;
+ $curri$012 = 2;
+ $primes$011 = 0;
+ while (1) {
+ $call10 = Math_fround(Math_sqrt(Math_fround(Math_fround($curri$012 | 0))));
+ L15 : do {
+ if ($call10 > Math_fround(+2)) {
+ $j$010 = 2;
+ while (1) {
+ $inc = $j$010 + 1 | 0;
+ if ((($curri$012 | 0) % ($j$010 | 0) & -1 | 0) == 0) {
+ $ok$0 = 0;
+ break L15;
+ }
+ if (Math_fround($inc | 0) < $call10) {
+ $j$010 = $inc;
+ } else {
+ $ok$0 = 1;
+ break;
+ }
+ }
+ } else {
+ $ok$0 = 1;
+ }
+ } while (0);
+ $primes$011 = $ok$0 + $primes$011 | 0;
+ if (($primes$011 | 0) >= ($arg$0 | 0)) {
+ break;
+ } else {
+ $curri$012 = $curri$012 + 1 | 0;
+ }
+ }
+ HEAP32[$vararg_buffer1 >> 2] = $curri$012;
+ return $retval$0 | 0;
+}