diff options
author | Max Graey <maxgraey@gmail.com> | 2020-08-24 18:30:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 08:30:33 -0700 |
commit | d2e2521e55120465549ddbccc4660ff98e929008 (patch) | |
tree | b03bad00edbc3ffa06e28be227d14816d657d4ed /test/passes/optimize-instructions_optimize-level=2_ignore-implicit-traps.wast | |
parent | 33ccea3bdcb82f638c888b36bb779291d04568f3 (diff) | |
download | binaryen-d2e2521e55120465549ddbccc4660ff98e929008.tar.gz binaryen-d2e2521e55120465549ddbccc4660ff98e929008.tar.bz2 binaryen-d2e2521e55120465549ddbccc4660ff98e929008.zip |
memory.copy: use nop reductions only for ignoreImplicitTraps (#3074)
According to changes in spec:
WebAssembly/bulk-memory-operations#124
WebAssembly/bulk-memory-operations#145
we unfortunately can't fold to nop even for memory.copy(x, y, 0).
So this PR revert all reductions to nop but do this only under ignoreImplicitTraps flag
Diffstat (limited to 'test/passes/optimize-instructions_optimize-level=2_ignore-implicit-traps.wast')
-rw-r--r-- | test/passes/optimize-instructions_optimize-level=2_ignore-implicit-traps.wast | 365 |
1 files changed, 0 insertions, 365 deletions
diff --git a/test/passes/optimize-instructions_optimize-level=2_ignore-implicit-traps.wast b/test/passes/optimize-instructions_optimize-level=2_ignore-implicit-traps.wast deleted file mode 100644 index 802ca1875..000000000 --- a/test/passes/optimize-instructions_optimize-level=2_ignore-implicit-traps.wast +++ /dev/null @@ -1,365 +0,0 @@ -(module - (type $0 (func (param i32 i32) (result i32))) - (memory $0 0) - (func $conditionals (type $0) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local.set $0 - (i32.const 0) - ) - (loop $while-in - (local.set $3 - (i32.const 0) - ) - (loop $while-in6 - (local.set $6 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $0 - (if (result i32) - (i32.or ;; this or is very expensive. we should compute one side, then see if we even need the other - (i32.eqz - (i32.rem_s - (i32.add - (i32.mul - (local.tee $7 ;; side effect, so we can't do this one - (i32.add - (local.get $0) - (i32.const 2) - ) - ) - (local.get $0) - ) - (i32.const 17) - ) - (i32.const 5) - ) - ) - (i32.eqz - (i32.rem_u - (i32.add - (i32.mul - (local.get $0) - (local.get $0) - ) - (i32.const 11) - ) - (i32.const 3) - ) - ) - ) - (local.get $7) - (local.get $6) - ) - ) - (br_if $while-in6 - (i32.lt_s - (local.tee $3 - (i32.add - (local.get $3) - (i32.const 1) - ) - ) - (local.get $4) - ) - ) - ) - (br_if $while-in - (i32.ne - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (i32.const 27000) - ) - ) - ) - (return - (local.get $5) - ) - ) - (func $side-effect (type $0) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local.set $0 - (i32.const 0) - ) - (loop $while-in - (local.set $3 - (i32.const 0) - ) - (loop $while-in6 - (local.set $6 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $0 - (if (result i32) - (i32.or ;; this or is very expensive, but has a side effect on both sides - (i32.eqz - (i32.rem_s - (i32.add - (i32.mul - (local.tee $7 - (i32.add - (local.get $0) - (i32.const 0) - ) - ) - (local.get $0) - ) - (i32.const 17) - ) - (i32.const 5) - ) - ) - (i32.eqz - (i32.rem_u - (i32.add - (i32.mul - (local.get $0) - (local.get $0) - ) - (unreachable) - ) - (i32.const 3) - ) - ) - ) - (local.get $7) - (local.get $6) - ) - ) - (br_if $while-in6 - (i32.lt_s - (local.tee $3 - (i32.add - (local.get $3) - (i32.const 1) - ) - ) - (local.get $4) - ) - ) - ) - (br_if $while-in - (i32.ne - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (i32.const 27000) - ) - ) - ) - (return - (local.get $5) - ) - ) - (func $flip (type $0) (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local.set $0 - (i32.const 0) - ) - (loop $while-in - (local.set $3 - (i32.const 0) - ) - (loop $while-in6 - (local.set $6 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $0 - (if (result i32) - (i32.or ;; this or is very expensive, and the first side has no side effect - (i32.eqz - (i32.rem_s - (i32.add - (i32.mul - (i32.eqz - (i32.add - (local.get $0) - (i32.const 0) - ) - ) - (local.get $0) - ) - (i32.const 17) - ) - (i32.const 5) - ) - ) - (i32.eqz - (i32.rem_u - (i32.add - (i32.mul - (local.get $0) - (local.get $0) - ) - (i32.const 100) - ) - (i32.const 3) - ) - ) - ) - (local.get $7) - (local.get $6) - ) - ) - (br_if $while-in6 - (i32.lt_s - (local.tee $3 - (i32.add - (local.get $3) - (i32.const 1) - ) - ) - (local.get $4) - ) - ) - ) - (br_if $while-in - (i32.ne - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (i32.const 27000) - ) - ) - ) - (return - (local.get $5) - ) - ) - (func $invalidate-conditionalizeExpensiveOnBitwise (param $0 i32) (param $1 i32) (result i32) - (if - (i32.eqz - (i32.and - (i32.lt_s - (i32.and - (i32.shr_s - (i32.shl - (i32.add - (local.get $1) ;; conflict with tee - (i32.const -1) - ) - (i32.const 24) - ) - (i32.const 24) - ) - (i32.const 255) - ) - (i32.const 3) - ) - (i32.ne - (local.tee $1 - (i32.const 0) - ) - (i32.const 0) - ) - ) - ) - (return (local.get $0)) - ) - (return (local.get $1)) - ) - (func $invalidate-conditionalizeExpensiveOnBitwise-ok (param $0 i32) (param $1 i32) (result i32) - (if - (i32.eqz - (i32.and - (i32.lt_s - (i32.and - (i32.shr_s - (i32.shl - (i32.add - (local.get $0) ;; no conflict - (i32.const -1) - ) - (i32.const 24) - ) - (i32.const 24) - ) - (i32.const 255) - ) - (i32.const 3) - ) - (i32.ne - (local.tee $1 - (i32.const 0) - ) - (i32.const 0) - ) - ) - ) - (return (local.get $0)) - ) - (return (local.get $1)) - ) - - (func $conditionalize-if-type-change (result f64) - (local $0 i32) - (drop - (loop $label$1 (result f32) - (block $label$2 (result f32) - (drop - (block $label$3 (result f32) - (br_if $label$1 - (i32.or ;; this turns into an if, but then the if might not be unreachable - (f32.gt - (br_if $label$3 - (f32.const 1) - (local.get $0) - ) - (br $label$2 - (f32.const 71) - ) - ) - (i64.eqz - (select - (i64.const 58) - (i64.const -982757) - (i64.eqz - (i64.const 0) - ) - ) - ) - ) - ) - ) - ) - (f32.const 1) - ) - ) - ) - (f64.const -nan:0xfffffffffffff) - ) -) - |