summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-11-07 22:30:18 -0800
committerGitHub <noreply@github.com>2019-11-07 22:30:18 -0800
commit4ad7a2cfd0b3ac14fbe767d50e4994f8297d37f6 (patch)
tree7ddc2211e1bace767dfce94f9622db9629e46c6d
parent42f70a7c8608f5fc85b2676fda29b8405459ebdf (diff)
downloadbinaryen-4ad7a2cfd0b3ac14fbe767d50e4994f8297d37f6.tar.gz
binaryen-4ad7a2cfd0b3ac14fbe767d50e4994f8297d37f6.tar.bz2
binaryen-4ad7a2cfd0b3ac14fbe767d50e4994f8297d37f6.zip
Add Stack IR optimization support for EH (#2425)
-rw-r--r--src/passes/StackIR.cpp10
-rw-r--r--test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_enable-exception-handling.txt (renamed from test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt)0
-rw-r--r--test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_enable-exception-handling.wast (renamed from test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast)0
3 files changed, 7 insertions, 3 deletions
diff --git a/src/passes/StackIR.cpp b/src/passes/StackIR.cpp
index 9b8b9b8b1..52ea061a3 100644
--- a/src/passes/StackIR.cpp
+++ b/src/passes/StackIR.cpp
@@ -255,7 +255,9 @@ private:
case StackInst::BlockEnd:
case StackInst::IfElse:
case StackInst::IfEnd:
- case StackInst::LoopEnd: {
+ case StackInst::LoopEnd:
+ case StackInst::Catch:
+ case StackInst::TryEnd: {
return true;
}
default: { return false; }
@@ -267,7 +269,8 @@ private:
switch (inst->op) {
case StackInst::BlockBegin:
case StackInst::IfBegin:
- case StackInst::LoopBegin: {
+ case StackInst::LoopBegin:
+ case StackInst::TryBegin: {
return true;
}
default: { return false; }
@@ -279,7 +282,8 @@ private:
switch (inst->op) {
case StackInst::BlockEnd:
case StackInst::IfEnd:
- case StackInst::LoopEnd: {
+ case StackInst::LoopEnd:
+ case StackInst::TryEnd: {
return true;
}
default: { return false; }
diff --git a/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_enable-exception-handling.txt
index 2a9cf6be7..2a9cf6be7 100644
--- a/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.txt
+++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_enable-exception-handling.txt
diff --git a/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_enable-exception-handling.wast
index c355a2bf1..c355a2bf1 100644
--- a/test/passes/generate-stack-ir_print-stack-ir_enable-exception-handling.wast
+++ b/test/passes/generate-stack-ir_optimize-stack-ir_print-stack-ir_enable-exception-handling.wast