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
3 changes: 2 additions & 1 deletion src/passes/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2786,7 +2786,8 @@ void PrintSExpression::maybePrintUnreachableReplacement(Expression* curr,
// Emit a block with drops of the children.
o << "(block";
if (!minify) {
o << " ;; (replaces something unreachable we can't emit)";
o << " ;; (replaces unreachable " << getExpressionName(curr)
<< " we can't emit)";
}
incIndent();
for (auto* child : ChildIterator(curr)) {
Expand Down
6 changes: 3 additions & 3 deletions test/lit/passes/cfp.wast
Original file line number Diff line number Diff line change
Expand Up @@ -508,22 +508,22 @@

;; CHECK: (func $test (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructSet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/dae-gc-refine-return.wast
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
(return_call_ref $"return_{}" (local.get $"return_{}"))
)
;; CHECK: (func $tail-caller-call_ref-unreachable (type $2) (result anyref)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/dae_all-features.wast
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@
;; CHECK: (type $1 (func))

;; CHECK: (func $no-caller (type $A) (result (ref $A))
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null nofunc)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/gsi.wast
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@
))

;; CHECK: (func $func (type $1) (param $ref (ref null $A)) (result i32)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/gto-removals.wast
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@

;; CHECK: (func $new-unreachable (type $4)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 2)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/gufa-extern.wast
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

;; CHECK: (func $non-exported (type $0) (param $ext externref) (param $any anyref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (extern.internalize
;; CHECK-NEXT: (unreachable)
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/gufa-refs.wast
Original file line number Diff line number Diff line change
Expand Up @@ -4567,7 +4567,7 @@
)

;; CHECK: (func $call_ref-nofunc (type $2)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
Expand Down
6 changes: 3 additions & 3 deletions test/lit/passes/gufa-tnh-closed.wast
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
)

;; CHECK: (func $caller (type $2) (param $x funcref)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -83,7 +83,7 @@
)

;; CHECK: (func $caller (type $0) (param $x funcref)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -496,7 +496,7 @@
;; CHECK-NEXT: (local.get $func3)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (struct.new_default $Y2)
;; CHECK-NEXT: )
Expand Down
6 changes: 3 additions & 3 deletions test/lit/passes/gufa-vs-cfp.wast
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@

;; CHECK: (func $test (type $0)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 10)
;; CHECK-NEXT: )
Expand All @@ -469,9 +469,9 @@
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructSet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
4 changes: 2 additions & 2 deletions test/lit/passes/heap2local.wast
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@

;; CHECK: (func $ignore-unreachable (type $1)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 2)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/inlining-optimizing.wast
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)
;; CHECK: (func $1 (type $none_=>_none)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/inlining_vacuum_optimize-instructions.wast
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

;; CHECK: (func $target (type $2) (param $0 (ref null $A))
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/local-subtyping.wast
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
;; CHECK-NEXT: (ref.null nofunc)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.set $x
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.get $f)
;; CHECK-NEXT: )
Expand Down
4 changes: 2 additions & 2 deletions test/lit/passes/optimize-instructions-call_ref.wast
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
)

;; CHECK: (func $fallthrough-bad-type (type $none_=>_i32) (result i32)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result (ref nofunc))
;; CHECK-NEXT: (drop
Expand Down Expand Up @@ -213,7 +213,7 @@
)

;; CHECK: (func $ignore-unreachable (type $none_=>_none)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/optimize-instructions-gc-heap.wast
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@
;; CHECK: (func $unreachable (type $1)
;; CHECK-NEXT: (local $ref (ref null $struct))
;; CHECK-NEXT: (local.tee $ref
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
4 changes: 2 additions & 2 deletions test/lit/passes/optimize-instructions-gc-iit.wast
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand All @@ -126,7 +126,7 @@
;; TNH-NEXT: )
;; TNH-NEXT: )
;; TNH-NEXT: (drop
;; TNH-NEXT: (block ;; (replaces something unreachable we can't emit)
;; TNH-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; TNH-NEXT: (drop
;; TNH-NEXT: (unreachable)
;; TNH-NEXT: )
Expand Down
8 changes: 4 additions & 4 deletions test/lit/passes/optimize-instructions-gc-tnh.wast
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@
)

;; TNH: (func $null.arm.null.effects (type $void)
;; TNH-NEXT: (block ;; (replaces something unreachable we can't emit)
;; TNH-NEXT: (block ;; (replaces unreachable StructSet we can't emit)
;; TNH-NEXT: (drop
;; TNH-NEXT: (select
;; TNH-NEXT: (unreachable)
Expand All @@ -523,7 +523,7 @@
;; TNH-NEXT: )
;; TNH-NEXT: )
;; NO_TNH: (func $null.arm.null.effects (type $void)
;; NO_TNH-NEXT: (block ;; (replaces something unreachable we can't emit)
;; NO_TNH-NEXT: (block ;; (replaces unreachable StructSet we can't emit)
;; NO_TNH-NEXT: (drop
;; NO_TNH-NEXT: (select
;; NO_TNH-NEXT: (unreachable)
Expand Down Expand Up @@ -904,15 +904,15 @@
)

;; TNH: (func $select.unreachable.child (type $6) (param $x (ref $struct)) (result (ref $struct))
;; TNH-NEXT: (block ;; (replaces something unreachable we can't emit)
;; TNH-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; TNH-NEXT: (drop
;; TNH-NEXT: (unreachable)
;; TNH-NEXT: )
;; TNH-NEXT: (unreachable)
;; TNH-NEXT: )
;; TNH-NEXT: )
;; NO_TNH: (func $select.unreachable.child (type $6) (param $x (ref $struct)) (result (ref $struct))
;; NO_TNH-NEXT: (block ;; (replaces something unreachable we can't emit)
;; NO_TNH-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; NO_TNH-NEXT: (drop
;; NO_TNH-NEXT: (unreachable)
;; NO_TNH-NEXT: )
Expand Down
6 changes: 3 additions & 3 deletions test/lit/passes/optimize-instructions-gc.wast
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -2773,7 +2773,7 @@

;; CHECK: (func $struct.set.null.fallthrough (type $5)
;; CHECK-NEXT: (local $temp (ref null $struct))
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructSet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $temp
;; CHECK-NEXT: (unreachable)
Expand Down Expand Up @@ -2802,7 +2802,7 @@

;; CHECK: (func $set.array.null (type $5)
;; CHECK-NEXT: (local $temp (ref none))
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable ArraySet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $temp
;; CHECK-NEXT: (unreachable)
Expand Down
4 changes: 2 additions & 2 deletions test/lit/passes/precompute-gc-immutable.wast
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
;; CHECK: (func $unreachable (type $2)
;; CHECK-NEXT: (local $ref-imm (ref null $struct-imm))
;; CHECK-NEXT: (local.tee $ref-imm
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -223,7 +223,7 @@
;; CHECK: (func $local-null (type $2)
;; CHECK-NEXT: (local $ref-imm (ref null $struct-imm))
;; CHECK-NEXT: (call $helper
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
Expand Down
6 changes: 3 additions & 3 deletions test/lit/passes/precompute-gc.wast
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -787,7 +787,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructGet we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -851,7 +851,7 @@
)

;; CHECK: (func $new_block_unreachable (type $8) (result anyref)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block
;; CHECK-NEXT: (unreachable)
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/remove-unused-brs-gc.wast
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@
;; CHECK: (func $fallthrough-unreachable (type $6) (param $0 i31ref) (result anyref)
;; CHECK-NEXT: (block $outer
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block
;; CHECK-NEXT: (drop
Expand Down
8 changes: 4 additions & 4 deletions test/lit/passes/remove-unused-module-elements-refs.wast
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
;; CHECK-NEXT: (call_ref $A
;; CHECK-NEXT: (local.get $A)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -80,7 +80,7 @@
;; OPEN_WORLD-NEXT: (call_ref $A
;; OPEN_WORLD-NEXT: (local.get $A)
;; OPEN_WORLD-NEXT: )
;; OPEN_WORLD-NEXT: (block ;; (replaces something unreachable we can't emit)
;; OPEN_WORLD-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; OPEN_WORLD-NEXT: (drop
;; OPEN_WORLD-NEXT: (unreachable)
;; OPEN_WORLD-NEXT: )
Expand Down Expand Up @@ -810,7 +810,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down Expand Up @@ -871,7 +871,7 @@
;; OPEN_WORLD-NEXT: )
;; OPEN_WORLD-NEXT: )
;; OPEN_WORLD-NEXT: (drop
;; OPEN_WORLD-NEXT: (block ;; (replaces something unreachable we can't emit)
;; OPEN_WORLD-NEXT: (block ;; (replaces unreachable StructNew we can't emit)
;; OPEN_WORLD-NEXT: (drop
;; OPEN_WORLD-NEXT: (unreachable)
;; OPEN_WORLD-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/signature-pruning.wast
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@

;; CHECK: (func $0 (type $0)
;; CHECK-NEXT: (local $0 f32)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable RefCast we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/signature-refining.wast
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@
(type $F (func))

;; CHECK: (func $func (type $F)
;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit)
;; CHECK-NEXT: (block ;; (replaces unreachable CallRef we can't emit)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null nofunc)
;; CHECK-NEXT: )
Expand Down
Loading