summaryrefslogtreecommitdiff
path: root/src/passes/LocalSubtyping.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/LocalSubtyping.cpp')
-rw-r--r--src/passes/LocalSubtyping.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/passes/LocalSubtyping.cpp b/src/passes/LocalSubtyping.cpp
index eeaaaaefa..ad0cfa7d2 100644
--- a/src/passes/LocalSubtyping.cpp
+++ b/src/passes/LocalSubtyping.cpp
@@ -78,27 +78,11 @@ struct LocalSubtyping : public WalkerPass<PostWalker<LocalSubtyping>> {
// Find which vars can be non-nullable.
std::unordered_set<Index> cannotBeNonNullable;
- if (getModule()->features.hasGCNNLocals()) {
- // If the feature is enabled then the only constraint is being able to
- // read the default value - if it is readable, the local cannot become
- // non-nullable.
- for (auto& [get, sets] : localGraph.getSetses) {
- auto index = get->index;
- if (func->isVar(index) &&
- std::any_of(sets.begin(), sets.end(), [&](LocalSet* set) {
- return set == nullptr;
- })) {
- cannotBeNonNullable.insert(index);
- }
- }
- } else {
- // Without GCNNLocals, validation rules follow the spec rules: all gets
- // must be dominated structurally by sets, for the local to be non-
- // nullable.
- LocalStructuralDominance info(func, *getModule());
- for (auto index : info.nonDominatingIndices) {
- cannotBeNonNullable.insert(index);
- }
+ // All gets must be dominated structurally by sets for the local to be non-
+ // nullable.
+ LocalStructuralDominance info(func, *getModule());
+ for (auto index : info.nonDominatingIndices) {
+ cannotBeNonNullable.insert(index);
}
auto varBase = func->getVarIndexBase();