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 scripts/fuzz_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2370,6 +2370,7 @@ def write_commands(commands, filename):
("--remove-unused-types",),
("--abstract-type-refining",),
("--cfp",),
("--cfp-reftest",),
("--gsi",),
("--type-ssa",),
("--type-merging",)}
Expand Down
4 changes: 4 additions & 0 deletions src/passes/ConstantFieldPropagation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,10 @@ struct ConstantFieldPropagation : public Pass {
return;
}

if (!getPassOptions().closedWorld) {
Fatal() << "CFP requires --closed-world";
}

// Find and analyze all writes inside each function.
PCVFunctionStructValuesMap functionNewInfos(*module),
functionSetInfos(*module);
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/cfp-desc.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: foreach %s %t wasm-opt --cfp -all -S -o - | filecheck %s
;; RUN: foreach %s %t wasm-opt --cfp --closed-world -all -S -o - | filecheck %s

(module
(rec
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/cfp-reftest-desc.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: foreach %s %t wasm-opt --cfp-reftest -all -S -o - | filecheck %s
;; RUN: foreach %s %t wasm-opt --cfp-reftest --closed-world -all -S -o - | filecheck %s

;; When a ref.get_desc can only read from two types, and those types have a
;; constant field, we can select between those two values using a ref.test.
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/cfp-reftest.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: foreach %s %t wasm-opt --cfp-reftest -all -S -o - | filecheck %s
;; RUN: foreach %s %t wasm-opt --cfp-reftest --closed-world -all -S -o - | filecheck %s

;; When a struct.get can only read from two types, and those types have a
;; constant field, we can select between those two values using a ref.test.
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/cfp-rmw.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: foreach %s %t wasm-opt --cfp -all -S -o - | filecheck %s
;; RUN: foreach %s %t wasm-opt --cfp --closed-world -all -S -o - | filecheck %s

;; RMW ops are generally writes that inhibit optimization.
(module
Expand Down
2 changes: 1 addition & 1 deletion test/lit/passes/cfp.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; RUN: foreach %s %t wasm-opt --remove-unused-names --cfp -all -S -o - | filecheck %s
;; RUN: foreach %s %t wasm-opt --remove-unused-names --cfp --closed-world -all -S -o - | filecheck %s

;; (remove-unused-names is added to test fallthrough values without a block
;; name getting in the way)
Expand Down
Loading