diff options
-rw-r--r-- | src/passes/DeadArgumentElimination.cpp | 2 | ||||
-rw-r--r-- | test/passes/dae_all-features.txt | 10 | ||||
-rw-r--r-- | test/passes/dae_all-features.wast | 11 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/passes/DeadArgumentElimination.cpp b/src/passes/DeadArgumentElimination.cpp index 975b291b0..59337f75d 100644 --- a/src/passes/DeadArgumentElimination.cpp +++ b/src/passes/DeadArgumentElimination.cpp @@ -41,6 +41,7 @@ #include "ir/effects.h" #include "ir/element-utils.h" #include "ir/module-utils.h" +#include "ir/type-updating.h" #include "pass.h" #include "passes/opt-utils.h" #include "support/sorted_vector.h" @@ -382,6 +383,7 @@ struct DAE : public Pass { // Wonderful, nothing stands in our way! Do it. // TODO: parallelize this? removeParameter(func, i, calls); + TypeUpdating::handleNonNullableLocals(func, *module); changed.insert(func); } } diff --git a/test/passes/dae_all-features.txt b/test/passes/dae_all-features.txt index ea439bc9e..773701396 100644 --- a/test/passes/dae_all-features.txt +++ b/test/passes/dae_all-features.txt @@ -312,3 +312,13 @@ ) ) ) +(module + (type $none_=>_none (func)) + (func $0 + (local $0 (ref null i31)) + (nop) + ) + (func $1 + (call $0) + ) +) diff --git a/test/passes/dae_all-features.wast b/test/passes/dae_all-features.wast index 55e935f3b..67244cc23 100644 --- a/test/passes/dae_all-features.wast +++ b/test/passes/dae_all-features.wast @@ -193,3 +193,14 @@ ) ) ) +(module + ;; a removable non-nullable parameter + (func $0 (param $x i31ref) + (nop) + ) + (func $1 + (call $0 + (i31.new (i32.const 0)) + ) + ) +) |