[NFC] Remove outdated mentions of nominal types#8142
Merged
Merged
Conversation
Fix comments and tests mentioning the experimental nominal type system that existed before GC was standardized. As a drive-by, remove some adjacent dead code in OptimizeInstructions that has not been relevant since we updated If finalization to propage unreachability.
kripken
reviewed
Dec 17, 2025
| // (local.get $z) | ||
| // ) | ||
| // ) | ||
| assert(curr->ifTrue->type == curr->ifFalse->type); |
Member
There was a problem hiding this comment.
I'm not clear on why this assertion isn't needed? And why the if below it as well?
Member
Author
There was a problem hiding this comment.
This assertion isn't wrong, but it's not contributing much value after we remove the code below. The code below isn't necessary:
- if
newOuterTypeis unreachable, then both arms of theiforselectmust be unreachable, which means thatcurr->typeis also unreachable and the branch will not be taken. - Otherwise
newOuterTypeis not unreachable and neither arm is unreachable. In this casecurr->typecan only be unreachable if theiforselectcondition is unreachable. But since we're not changing the condition, theiforselectwill remain unreachable after optimizing and that unreachability will bubble up so that thecurr->typecontinues to be unreachable after the optimization is applied, so there's no problem we need to avoid.
kripken
reviewed
Dec 17, 2025
| ;; CHECK-NEXT: (nop) | ||
| ;; CHECK-NEXT: (nop) | ||
| ;; CHECK-NEXT: (nop) | ||
| ;; CHECK-NEXT: (nop) |
Member
Author
There was a problem hiding this comment.
The test was not previously testing what it claimed to test, which was the case where $types$1 is not the same as $type$2. After fixing the types to match the intent of the test, the optimization no longer applies.
kripken
approved these changes
Dec 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix comments and tests mentioning the experimental nominal type system
that existed before GC was standardized. As a drive-by, remove some
adjacent dead code in OptimizeInstructions that has not been relevant
since we updated If finalization to propage unreachability.