diff options
author | Thomas Lively <tlively@google.com> | 2023-09-18 21:53:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 21:53:32 -0700 |
commit | 6bab227860a6873204141e5ec9b14ed08d77fc62 (patch) | |
tree | afd006c5ad6620d04763b67b62c3b0ec1091ee21 /test | |
parent | 8c5bb9b8a0b150ebab0d0dec545206b055de9564 (diff) | |
download | binaryen-6bab227860a6873204141e5ec9b14ed08d77fc62.tar.gz binaryen-6bab227860a6873204141e5ec9b14ed08d77fc62.tar.bz2 binaryen-6bab227860a6873204141e5ec9b14ed08d77fc62.zip |
Do not optimize tuple locals in StackIR local2stack (#5958)
This Stack IR optimization is not compatible with a much more powerful
optimization we plan to do for tuples in the binary writer.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/optimize-stack-ir.wast | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/lit/passes/optimize-stack-ir.wast b/test/lit/passes/optimize-stack-ir.wast index 12981df9a..d937f7257 100644 --- a/test/lit/passes/optimize-stack-ir.wast +++ b/test/lit/passes/optimize-stack-ir.wast @@ -1398,4 +1398,33 @@ ) ) ) + + ;; CHECK: (func $tuple-local2stack (type $FUNCSIG$v) + ;; CHECK-NEXT: (local $pair (f32 i32)) + ;; CHECK-NEXT: (local $f32 f32) + ;; CHECK-NEXT: f32.const 0 + ;; CHECK-NEXT: i32.const 0 + ;; CHECK-NEXT: tuple.make + ;; CHECK-NEXT: local.set $pair + ;; CHECK-NEXT: local.get $pair + ;; CHECK-NEXT: tuple.extract 0 + ;; CHECK-NEXT: local.set $f32 + ;; CHECK-NEXT: ) + (func $tuple-local2stack + (local $pair (f32 i32)) + (local $f32 f32) + ;; We should not optimize out this get-set pair in Stack IR since we can do + ;; better in the binary writer. + (local.set $pair + (tuple.make + (f32.const 0) + (i32.const 0) + ) + ) + (local.set $f32 + (tuple.extract 0 + (local.get $pair) + ) + ) + ) ) |