Repository navigation
Improving global folding and IPO for immutable globals. - #18066
Merged
Merged
Conversation
benvanik
marked this pull request as draft
July 31, 2024 21:50
ScottTodd
approved these changes
Jul 31, 2024
Member
|
Oh, test failures :P well, code LGTM |
benvanik
force-pushed
the
users/benvanik/immutable-globals
branch
from
July 31, 2024 22:23
f7eb973 to
c3847e5
Compare
Parameters and constants end up as globals that previously were not getting marked as immutable unless the globals were default initialized. Now the GlobalTable tracks whether a global is exclusively stored within initializers (or functions only called from initializers) in order to mark them as immutable. IPO was updated to support propagating uniform immutable global loads across call edges as if they were constants (as they effectively are just constants stored on the global scope).
benvanik
force-pushed
the
users/benvanik/immutable-globals
branch
from
July 31, 2024 22:41
c3847e5 to
a2db7d0
Compare
benvanik
marked this pull request as ready for review
July 31, 2024 22:53
benvanik
requested review from
IanWood1,
MaheshRavishankar and
hanhanW
as code owners
July 31, 2024 22:53
benvanik
requested review from
ScottTodd
and removed request for
IanWood1,
MaheshRavishankar and
hanhanW
July 31, 2024 22:54
Collaborator
Author
|
(fixed tests/lint, PTAL) |
ScottTodd
approved these changes
Jul 31, 2024
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.
Parameters and constants end up as globals that previously were not getting marked as immutable unless the globals were default initialized. Now the GlobalTable tracks whether a global is exclusively stored within initializers (or functions only called from initializers) in order to mark them as immutable. IPO was updated to support propagating uniform immutable global loads across call edges as if they were constants (as they effectively are just constants stored on the global scope).
Required for #17875 (to avoid treating constants/parameters as dynamic binding table values).