diff options
author | Thomas Lively <tlively@google.com> | 2022-11-22 23:41:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-23 05:41:49 +0000 |
commit | 2c0fb8c513b3534576383d250c593a9bd28347e3 (patch) | |
tree | 993b23de3e8e5007fd3a32242cda95e7172ad765 /src/passes | |
parent | 853b31ec89416bef0014e06f2defaef74f47b81e (diff) | |
download | binaryen-2c0fb8c513b3534576383d250c593a9bd28347e3.tar.gz binaryen-2c0fb8c513b3534576383d250c593a9bd28347e3.tar.bz2 binaryen-2c0fb8c513b3534576383d250c593a9bd28347e3.zip |
Remove equirecursive typing (#5240)
Equirecursive is no longer standards track and its implementation is extremely
complex. Remove it.
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/ConstantFieldPropagation.cpp | 4 | ||||
-rw-r--r-- | src/passes/GUFA.cpp | 7 | ||||
-rw-r--r-- | src/passes/GlobalRefining.cpp | 4 | ||||
-rw-r--r-- | src/passes/GlobalStructInference.cpp | 4 | ||||
-rw-r--r-- | src/passes/GlobalTypeOptimization.cpp | 4 | ||||
-rw-r--r-- | src/passes/Print.cpp | 4 | ||||
-rw-r--r-- | src/passes/SignaturePruning.cpp | 4 | ||||
-rw-r--r-- | src/passes/SignatureRefining.cpp | 4 | ||||
-rw-r--r-- | src/passes/pass.cpp | 5 |
9 files changed, 2 insertions, 38 deletions
diff --git a/src/passes/ConstantFieldPropagation.cpp b/src/passes/ConstantFieldPropagation.cpp index 5048b978b..c5b95b15a 100644 --- a/src/passes/ConstantFieldPropagation.cpp +++ b/src/passes/ConstantFieldPropagation.cpp @@ -187,10 +187,6 @@ struct ConstantFieldPropagation : public Pass { if (!module->features.hasGC()) { return; } - if (getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive) { - Fatal() << "CFP requires nominal/isorecursive typing"; - } // Find and analyze all writes inside each function. PCVFunctionStructValuesMap functionNewInfos(*module), diff --git a/src/passes/GUFA.cpp b/src/passes/GUFA.cpp index 9774c1bb7..4250c76e9 100644 --- a/src/passes/GUFA.cpp +++ b/src/passes/GUFA.cpp @@ -110,13 +110,6 @@ struct GUFAOptimizer return; } - if (type.isRef() && (getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive)) { - // Without type info we can't analyze subtypes, so we cannot infer - // anything about refs. - return; - } - // Ok, this is an interesting location that we might optimize. See what the // oracle says is possible there. auto contents = getContents(curr); diff --git a/src/passes/GlobalRefining.cpp b/src/passes/GlobalRefining.cpp index f994d4082..0576e3285 100644 --- a/src/passes/GlobalRefining.cpp +++ b/src/passes/GlobalRefining.cpp @@ -38,10 +38,6 @@ struct GlobalRefining : public Pass { if (!module->features.hasGC()) { return; } - 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 8bb4c0ba9..938350960 100644 --- a/src/passes/GlobalStructInference.cpp +++ b/src/passes/GlobalStructInference.cpp @@ -71,10 +71,6 @@ struct GlobalStructInference : public Pass { if (!module->features.hasGC()) { return; } - 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 // types are created in functions, because we will not be able to optimize diff --git a/src/passes/GlobalTypeOptimization.cpp b/src/passes/GlobalTypeOptimization.cpp index 95d8859e9..4f7ce7ac7 100644 --- a/src/passes/GlobalTypeOptimization.cpp +++ b/src/passes/GlobalTypeOptimization.cpp @@ -117,10 +117,6 @@ struct GlobalTypeOptimization : public Pass { if (!module->features.hasGC()) { return; } - if (getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive) { - Fatal() << "GlobalTypeOptimization requires nominal/isorecursive typing"; - } // Find and analyze struct operations inside each function. StructUtils::FunctionStructValuesMap<FieldInfo> functionNewInfos(*module), diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index a92b0a16a..d9e54b054 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -3034,9 +3034,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { o << '('; printMajor(o, "func "); printName(curr->name, o); - if (currModule && currModule->features.hasGC() && - (getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive)) { + if (currModule && currModule->features.hasGC()) { o << " (type "; printHeapType(o, curr->type, currModule) << ')'; } diff --git a/src/passes/SignaturePruning.cpp b/src/passes/SignaturePruning.cpp index e6a7aa44e..3244ee103 100644 --- a/src/passes/SignaturePruning.cpp +++ b/src/passes/SignaturePruning.cpp @@ -52,10 +52,6 @@ struct SignaturePruning : public Pass { if (!module->features.hasGC()) { return; } - if (getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive) { - Fatal() << "SignaturePruning requires nominal/isorecursive typing"; - } if (!module->tables.empty()) { // When there are tables we must also take their types into account, which diff --git a/src/passes/SignatureRefining.cpp b/src/passes/SignatureRefining.cpp index 488e2c6cc..132079b76 100644 --- a/src/passes/SignatureRefining.cpp +++ b/src/passes/SignatureRefining.cpp @@ -54,10 +54,6 @@ struct SignatureRefining : public Pass { if (!module->features.hasGC()) { return; } - if (getTypeSystem() != TypeSystem::Nominal && - getTypeSystem() != TypeSystem::Isorecursive) { - Fatal() << "SignatureRefining requires nominal/hybrid typing"; - } if (!module->tables.empty()) { // When there are tables we must also take their types into account, which diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 9643b489e..9daf8e1d3 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -593,10 +593,7 @@ void PassRunner::addDefaultGlobalOptimizationPrePasses() { if (options.optimizeLevel >= 2) { addIfNoDWARFIssues("once-reduction"); } - if (wasm->features.hasGC() && - (getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive) && - options.optimizeLevel >= 2) { + if (wasm->features.hasGC() && options.optimizeLevel >= 2) { addIfNoDWARFIssues("type-refining"); addIfNoDWARFIssues("signature-pruning"); addIfNoDWARFIssues("signature-refining"); |