Skip to content
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

SimplifyGlobals: Do not switch a get to use a global of another type #6605

Merged
merged 1 commit into from
May 20, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented May 17, 2024

If we wanted to switch types in such cases we'd need to refinalize (which is likely
worth doing, though other passes should refine globals anyhow).

(I am adding more fuzzing for globals, which is finding these bugs.)

@kripken kripken requested a review from tlively May 17, 2024 23:29
;; CHECK: (global $a (ref $struct) (struct.new_default $struct))
(global $a (ref $struct) (struct.new_default $struct))
;; CHECK: (global $b (ref $struct) (global.get $a))
(global $b (ref $struct) (global.get $a))
Copy link
Member

Choose a reason for hiding this comment

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

What is the role of $b in this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to be comprehensive. $c is equal to both $a and $b but in different ways (it reads $a, but it has equal content to $b). I don't think we optimize both cases atm but this would handle things if we ever did.

@kripken kripken merged commit 3e33605 into WebAssembly:main May 20, 2024
13 checks passed
@kripken kripken deleted the sg.sub branch May 20, 2024 18:34
@gkdn gkdn mentioned this pull request Aug 31, 2024
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