Skip to content

Use GLB in PossibleContents::intersect #7550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged

Use GLB in PossibleContents::intersect #7550

merged 1 commit into from
Apr 28, 2025

Conversation

tlively
Copy link
Member

@tlively tlively commented Apr 25, 2025

Use the standard utility rather than reimplementing type intersection.
The new code is simpler, shorter, and properly supports exactness,
avoiding an assertion failure in the added test case. The other
functional change is that when one of the intersected heap types is
bottom and the type GLB is a non-nullable reference to bottom, the
result of the intersection is None where it was previously a Cone.

Use the standard utility rather than reimplementing type intersection.
The new code is simpler, shorter, and properly supports exactness,
avoiding an assertion failure in the added test case. The other
functional change is that when one of the intersected heap types is
bottom and the type GLB is a non-nullable reference to bottom, the
result of the intersection is `None` where it was previously a `Cone`.
@tlively tlively requested a review from kripken April 25, 2025 02:04
;; CHECK-NEXT: (global.get $global)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (ref.null none)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change? Previously the ref.cast emitted a nullable bottom type, and it should still keep doing so IIUC... the description mentions a change to non-nullable ones, but that's not the case here, so it must be something else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I was referring to with non-nullable references because the possible contents in $global is a non-null value, even though its static type is nullable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, the actual value is non-nullable, thanks!

;; CHECK-NEXT: (global.get $global)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (ref.null none)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, the actual value is non-nullable, thanks!

@tlively tlively merged commit d758b00 into main Apr 28, 2025
15 checks passed
@tlively tlively deleted the gufa-intersect-glb branch April 28, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants