diff options
author | Dan Gohman <sunfish@google.com> | 2013-07-01 17:29:45 -0700 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2013-07-01 17:29:45 -0700 |
commit | 0a2260ada3aa52de22168396b72de8851d3ca415 (patch) | |
tree | 4141332d987b0f5572ebf3856741ec0af6b49a80 /tools/test-js-optimizer-asm-pre-output.js | |
parent | 01708b7529bc4305272277c38c8f6c91ad27e367 (diff) |
Optimize (x<y)&1
Add an optimization to simplifyExpressionsPre to replace (x<y)&1 with x<y
if possible. This comes up frequently in C++ with bool variables.
Diffstat (limited to 'tools/test-js-optimizer-asm-pre-output.js')
-rw-r--r-- | tools/test-js-optimizer-asm-pre-output.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js index 301a2ec8..59a42010 100644 --- a/tools/test-js-optimizer-asm-pre-output.js +++ b/tools/test-js-optimizer-asm-pre-output.js @@ -119,6 +119,16 @@ function sign_extension_simplification() { print(5); } } +function compare_result_simplification() { + HEAP32[$4] = HEAP32[$5] < HEAP32[$6]; + HEAP32[$4] = HEAP32[$5] > HEAP32[$6]; + HEAP32[$4] = HEAP32[$5] <= HEAP32[$6]; + HEAP32[$4] = HEAP32[$5] <= HEAP32[$6]; + HEAP32[$4] = HEAP32[$5] == HEAP32[$6]; + HEAP32[$4] = HEAP32[$5] === HEAP32[$6]; + HEAP32[$4] = HEAP32[$5] != HEAP32[$6]; + var x = HEAP32[$5] != HEAP32[$6] | 0; +} function tempDoublePtr($45, $14, $28, $42) { $45 = $45 | 0; $14 = $14 | 0; |