Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/passes/Precompute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class PrecomputingExpressionRunner
}
// ArrayLen is not disallowed here as it is an immutable property.
Flow visitArrayCopy(ArrayCopy* curr) { return Flow(NONCONSTANT_FLOW); }
Flow visitArrayStore(ArrayStore* curr) { return Flow(NONCONSTANT_FLOW); }

// Generates heap info for a heap-allocating expression.
Flow getGCAllocation(Expression* curr, std::function<Flow()> visitFunc) {
Expand Down
24 changes: 24 additions & 0 deletions test/lit/passes/precompute-gc-multibyte.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.

;; RUN: foreach %s %t wasm-opt --precompute-propagate -all -S -o - | filecheck %s

(module
;; CHECK: (type $array (array (mut i8)))
(type $array (array (mut i8)))

;; CHECK: (func $array.store (type $1) (param $x (ref $array))
;; CHECK-NEXT: (i64.store32 (type $array)
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (i64.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $array.store (param $x (ref $array))
;; ArrayStore operations cannot be removed.
(i64.store32 (type $array)
(local.get $x)
(i32.const 0)
(i64.const 1)
)
)
)
Loading