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

Update GTO and TypeRefining for Struct RMW operations #7262

Merged
merged 4 commits into from
Feb 4, 2025

Conversation

tlively
Copy link
Member

@tlively tlively commented Feb 1, 2025

Both passes use StructUtils::StructScanner to analyze struct operations.
Add support for RMW operations to this utility and update its users to
provide the new noteRMW hook. Test that GTO and TypeRefining
optimizations work as expected in the presence of RMW operations, but
leave a proper implementation in ConstantFieldPropagation to a later PR.

To allow TypeRefining to refine field types based only on the
"replacement" operand and not the "expected" operand of cmpxchg
operations, update validation to allow the "expected" field to be a
supertype of the accessed field type as long as it is still equality
comparable.
WebAssembly/shared-everything-threads#92
clarifies this intended typing in the upstream proposal.

Both passes use StructUtils::StructScanner to analyze struct operations.
Add support for RMW operations to this utility and update its users to
provide the new `noteRMW` hook. Test that GTO and TypeRefining
optimizations work as expected in the presence of RMW operations, but
leave a proper implementation in ConstantFieldPropagation to a later PR.

To allow TypeRefining to refine field types based only on the
"replacement" operand and not the "expected" operand of cmpxchg
operations, update validation to allow the "expected" field to be a
supertype of the accessed field type as long as it is still equality
comparable.
WebAssembly/shared-everything-threads#92
clarifies this intended typing in the upstream proposal.
@tlively tlively requested a review from kripken February 1, 2025 03:00
auto heapType = type.getHeapType();
auto index = curr->index;
auto& info =
functionSetGetInfos[this->getFunction()][type.getHeapType()][curr->index];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
functionSetGetInfos[this->getFunction()][type.getHeapType()][curr->index];
functionSetGetInfos[this->getFunction()][type.getHeapType()][index];

@tlively tlively enabled auto-merge (squash) February 3, 2025 22:07
@tlively tlively merged commit b35228f into main Feb 4, 2025
14 checks passed
@tlively tlively deleted the struct-rmw-gto-type-refining branch February 4, 2025 00:24
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