diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-24 18:25:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-24 18:25:26 -0700 |
commit | f6bc44f11bace70754470694f9101ba9cc5c2887 (patch) | |
tree | c6862019f90650140f86c2c5c02377ba2b6ad3ce /test/unit.asm.js | |
parent | 49ddf2f8ba2439f767cdbeb656c6ff42d5530cf8 (diff) | |
parent | 97cf0d7bf6f115d44636dd52dc7c0036567ca798 (diff) | |
download | binaryen-f6bc44f11bace70754470694f9101ba9cc5c2887.tar.gz binaryen-f6bc44f11bace70754470694f9101ba9cc5c2887.tar.bz2 binaryen-f6bc44f11bace70754470694f9101ba9cc5c2887.zip |
Merge pull request #714 from WebAssembly/precompute-void
Precompute void expressions, which helps ifs
Diffstat (limited to 'test/unit.asm.js')
-rw-r--r-- | test/unit.asm.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/unit.asm.js b/test/unit.asm.js index 7b4b2a96f..c3adb2a3a 100644 --- a/test/unit.asm.js +++ b/test/unit.asm.js @@ -205,7 +205,7 @@ function asm(global, env, buffer) { print(1); do { print(5); - if (0) continue; + if (return_int()) continue; } while (0); print(2); } @@ -266,7 +266,7 @@ function asm(global, env, buffer) { function smallIf() { do { - if (2) { + if (return_int() | 0) { lb(3) | 0; } else { break; @@ -275,7 +275,7 @@ function asm(global, env, buffer) { } function dropCall() { - if (0) { + if (return_int() | 0) { phi(); // drop this setTempRet0(10); // this too zeroInit(setTempRet0(10) | 0); @@ -328,8 +328,8 @@ function asm(global, env, buffer) { function conditionalTypeFun() { var x = 0, y = +0; - x = 1 ? abort(5) | 0 : 2; - y = 3 ? +abort(7) : 4.5; + x = return_int() | 0 ? abort(5) | 0 : 2; + y = return_int() | 0 ? +abort(7) : 4.5; } function loadSigned(x) { @@ -358,7 +358,7 @@ function asm(global, env, buffer) { Int = x; globalOpts(); x = Int; - if (1) Int = 20; // but this does interfere + if (return_int() | 0) Int = 20; // but this does interfere Int = x; globalOpts(); x = Int; @@ -367,7 +367,7 @@ function asm(global, env, buffer) { } function dropCallImport() { - if (1) return_int() | 0; + if (return_int() | 0) return_int() | 0; } function loophi(x, y) { @@ -399,7 +399,7 @@ function asm(global, env, buffer) { j = 0; while(1) { temp = j; - if (1) { + if (return_int() | 0) { if (temp) { i$lcssa = i; break L7; |