diff options
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index fb46c79ec..28b13980b 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -794,12 +794,14 @@ struct SimplifyLocals // In other words, local.get is not necessarily free of effects if the local // is non-nullable - it must have been set already. We could check that // here, but running that linear-time check may not be worth it as this - // optimization is fairly minor, so just skip the non-nullable case. + // optimization is fairly minor, so just skip the non-nullable case (and in + // general, the non-defaultable case, of say a tuple with a non-nullable + // element). // // TODO investigate more Index goodIndex = sinkables.begin()->first; auto localType = this->getFunction()->getLocalType(goodIndex); - if (localType.isNonNullable()) { + if (!localType.isDefaultable()) { return; } |