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: Apply constant globals to segment offsets #6226

Merged
merged 7 commits into from
Jan 18, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Jan 17, 2024

We already applied such globals to other globals, but can do the same to offsets
of data and element segments.

Suggested in #6220 (comment)

Comment on lines +73 to +75
(drop
(global.get $use-defined)
)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use $use-imported too as a comparison?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, done.

Comment on lines +33 to +34
;; CHECK: (data $dropped "hello, world!")
(data $dropped "hello, world!")
Copy link
Member

Choose a reason for hiding this comment

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

Is this relevant to this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a segment without an offset, so the pass has nothing to do there but also it should not error on it (there is a nullptr for the offset). I added a comment to clarify.

@kripken kripken enabled auto-merge (squash) January 18, 2024 18:48
@kripken kripken merged commit 3049fb8 into WebAssembly:main Jan 18, 2024
14 checks passed
@kripken kripken deleted the rume.ginits branch January 18, 2024 19:21
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
…ly#6226)

We already applied such globals to other globals, but can do the same to offsets
of data and element segments.

Suggested in WebAssembly#6220
@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