summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/ConstantFieldPropagation.cpp5
-rw-r--r--src/passes/GlobalRefining.cpp5
-rw-r--r--src/passes/GlobalStructInference.cpp5
-rw-r--r--src/passes/GlobalTypeOptimization.cpp5
-rw-r--r--src/passes/SignaturePruning.cpp5
-rw-r--r--src/passes/pass.cpp4
6 files changed, 18 insertions, 11 deletions
diff --git a/src/passes/ConstantFieldPropagation.cpp b/src/passes/ConstantFieldPropagation.cpp
index 0f66fe28b..5048b978b 100644
--- a/src/passes/ConstantFieldPropagation.cpp
+++ b/src/passes/ConstantFieldPropagation.cpp
@@ -187,8 +187,9 @@ struct ConstantFieldPropagation : public Pass {
if (!module->features.hasGC()) {
return;
}
- if (getTypeSystem() != TypeSystem::Nominal) {
- Fatal() << "ConstantFieldPropagation requires nominal typing";
+ if (getTypeSystem() != TypeSystem::Nominal &&
+ getTypeSystem() != TypeSystem::Isorecursive) {
+ Fatal() << "CFP requires nominal/isorecursive typing";
}
// Find and analyze all writes inside each function.
diff --git a/src/passes/GlobalRefining.cpp b/src/passes/GlobalRefining.cpp
index f3bea3d3d..f994d4082 100644
--- a/src/passes/GlobalRefining.cpp
+++ b/src/passes/GlobalRefining.cpp
@@ -38,8 +38,9 @@ struct GlobalRefining : public Pass {
if (!module->features.hasGC()) {
return;
}
- if (getTypeSystem() != TypeSystem::Nominal) {
- Fatal() << "GlobalRefining requires nominal typing";
+ if (getTypeSystem() != TypeSystem::Nominal &&
+ getTypeSystem() != TypeSystem::Isorecursive) {
+ Fatal() << "GlobalRefining requires nominal/isorecursive typing";
}
// First, find all the global.sets.
diff --git a/src/passes/GlobalStructInference.cpp b/src/passes/GlobalStructInference.cpp
index d0810a7fa..4d39768e2 100644
--- a/src/passes/GlobalStructInference.cpp
+++ b/src/passes/GlobalStructInference.cpp
@@ -68,8 +68,9 @@ struct GlobalStructInference : public Pass {
if (!module->features.hasGC()) {
return;
}
- if (getTypeSystem() != TypeSystem::Nominal) {
- Fatal() << "GlobalStructInference requires nominal typing";
+ if (getTypeSystem() != TypeSystem::Nominal &&
+ getTypeSystem() != TypeSystem::Isorecursive) {
+ Fatal() << "GlobalStructInference requires nominal/isorecursive typing";
}
// First, find all the information we need. We need to know which struct
diff --git a/src/passes/GlobalTypeOptimization.cpp b/src/passes/GlobalTypeOptimization.cpp
index 694523200..95d8859e9 100644
--- a/src/passes/GlobalTypeOptimization.cpp
+++ b/src/passes/GlobalTypeOptimization.cpp
@@ -117,8 +117,9 @@ struct GlobalTypeOptimization : public Pass {
if (!module->features.hasGC()) {
return;
}
- if (getTypeSystem() != TypeSystem::Nominal) {
- Fatal() << "GlobalTypeOptimization requires nominal typing";
+ if (getTypeSystem() != TypeSystem::Nominal &&
+ getTypeSystem() != TypeSystem::Isorecursive) {
+ Fatal() << "GlobalTypeOptimization requires nominal/isorecursive typing";
}
// Find and analyze struct operations inside each function.
diff --git a/src/passes/SignaturePruning.cpp b/src/passes/SignaturePruning.cpp
index 4e6334057..e6a7aa44e 100644
--- a/src/passes/SignaturePruning.cpp
+++ b/src/passes/SignaturePruning.cpp
@@ -52,8 +52,9 @@ struct SignaturePruning : public Pass {
if (!module->features.hasGC()) {
return;
}
- if (getTypeSystem() != TypeSystem::Nominal) {
- Fatal() << "SignaturePruning requires nominal typing";
+ if (getTypeSystem() != TypeSystem::Nominal &&
+ getTypeSystem() != TypeSystem::Isorecursive) {
+ Fatal() << "SignaturePruning requires nominal/isorecursive typing";
}
if (!module->tables.empty()) {
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index 197a59f41..ae9f34584 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -572,7 +572,9 @@ void PassRunner::addDefaultGlobalOptimizationPrePasses() {
if (options.optimizeLevel >= 2) {
addIfNoDWARFIssues("once-reduction");
}
- if (wasm->features.hasGC() && getTypeSystem() == TypeSystem::Nominal &&
+ if (wasm->features.hasGC() &&
+ (getTypeSystem() == TypeSystem::Nominal ||
+ getTypeSystem() == TypeSystem::Isorecursive) &&
options.optimizeLevel >= 2) {
addIfNoDWARFIssues("type-refining");
addIfNoDWARFIssues("signature-pruning");