aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-asm-pre-output.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-05-13 13:49:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-05-13 13:49:59 -0700
commita2440907aeb89069a6f2a13bdaff888984cd3c62 (patch)
tree584e17076729395ac830d2738b7a091e64a9f215 /tools/test-js-optimizer-asm-pre-output.js
parentbcc312a226fd9b719dc00d569afabc62adc2f712 (diff)
conditionalize when it can avoid costly side-effect free code
Diffstat (limited to 'tools/test-js-optimizer-asm-pre-output.js')
-rw-r--r--tools/test-js-optimizer-asm-pre-output.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js
index c9746e78..ce45645c 100644
--- a/tools/test-js-optimizer-asm-pre-output.js
+++ b/tools/test-js-optimizer-asm-pre-output.js
@@ -538,4 +538,63 @@ function fcomp() {
if (5 >= ($b | 0)) return 5;
if (5 >= 5) return 5;
}
+function conditionalizeMe() {
+ if (x > 1 ? x + y + z + w > 12 : 0) {
+ b();
+ }
+ if (a() > 1 ? x + y + z + w > 12 : 0) {
+ b();
+ }
+ if (x > 1 & x + y + z + k() > 12) {
+ b();
+ }
+ if (a() > 1 & x + y + z + k() > 12) {
+ b();
+ }
+ if (x > 1 ? 1 : x + y + z + w > 12) {
+ b();
+ }
+ if (a() > 1 ? 1 : x + y + z + w > 12) {
+ b();
+ }
+ if (x > 1 | x + y + z + k() > 12) {
+ b();
+ }
+ if (a() > 1 | x + y + z + k() > 12) {
+ b();
+ }
+ if (x > 1 ? 1 : x + y + z + w > 12) {
+ b();
+ }
+ if (a() > 1 ? 1 : x + y + z + w > 12) {
+ b();
+ }
+ if (x + y + z + k() > 12 | x > 1) {
+ b();
+ }
+ if (x + y + z + k() > 12 | a() > 1) {
+ b();
+ }
+ while (x > 1 ? x + y + z + w > 12 : 0) {
+ b();
+ }
+ while (a() > 1 ? x + y + z + w > 12 : 0) {
+ b();
+ }
+ while (x > 1 & x + y + z + k() > 12) {
+ b();
+ }
+ while (a() > 1 & x + y + z + k() > 12) {
+ b();
+ }
+ if (!($sub$i480 >= Math_fround(+0)) | !($sub4$i483 >= Math_fround(+0))) {
+ b();
+ }
+ if ($sub$i480 >= Math_fround(+0) ? !($sub4$i483 >= Math_fround(HEAPF32[x + y | 0])) : 1) {
+ b();
+ }
+ if (x > 10 ? 1 : HEAP[20] > 5) {
+ b();
+ }
+}