summaryrefslogtreecommitdiff
path: root/src/passes/OptimizeInstructions.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-08-09 17:18:13 -0400
committerGitHub <noreply@github.com>2023-08-09 21:18:13 +0000
commitc003a01aa855bfa1377237eb2ce788b9fa96e839 (patch)
tree454d2b6de36ea56de5d3e310d81f02155aa73db1 /src/passes/OptimizeInstructions.cpp
parentd0bdf202463323a0b9f3be95fe2c64765a84a4b7 (diff)
downloadbinaryen-c003a01aa855bfa1377237eb2ce788b9fa96e839.tar.gz
binaryen-c003a01aa855bfa1377237eb2ce788b9fa96e839.tar.bz2
binaryen-c003a01aa855bfa1377237eb2ce788b9fa96e839.zip
Remove legacy WasmGC instructions (#5861)
Remove old, experimental instructions and type encodings that will not be shipped as part of WasmGC. Updating the encodings and text format to match the final spec is left as future work.
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r--src/passes/OptimizeInstructions.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 44078545b..965f8b2d8 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -1406,13 +1406,13 @@ struct OptimizeInstructions
// skipCast do): removing a cast is potentially dangerous, as it removes
// information from the IR. For example:
//
- // (ref.is_func
- // (ref.as_func
+ // (ref.test (ref i31)
+ // (ref.cast (ref i31)
// (local.get $anyref)))
//
// The local has no useful type info here (it is anyref). The cast forces it
- // to be a function, so we know that if we do not trap then the ref.is will
- // definitely be 1. But if we removed the ref.as first (which we can do in
+ // to be an i31, so we know that if we do not trap then the ref.test will
+ // definitely be 1. But if we removed the ref.cast first (which we can do in
// traps-never-happen mode) then we'd not have the type info we need to
// optimize that way.
//
@@ -1420,12 +1420,12 @@ struct OptimizeInstructions
//
// * Before removing a cast we should use its type information in the best
// way we can. Only after doing so should a cast be removed. In the exmaple
- // above, that means first seeing that the ref.is must return 1, and only
- // then possibly removing the ref.as.
+ // above, that means first seeing that the ref.test must return 1, and only
+ // then possibly removing the ref.cast.
// * Do not remove a cast if removing it might remove useful information for
// others. For example,
//
- // (ref.cast $A
+ // (ref.cast (ref null $A)
// (ref.as_non_null ..))
//
// If we remove the inner cast then the outer cast becomes nullable. That