Skip to content

Fix tests of refinalization after optimization of selects #7595

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 7 commits into from
May 14, 2025

Conversation

tlively
Copy link
Member

@tlively tlively commented May 14, 2025

According to their comments, these tests purported to show that refinalize was
run after optimizing a select to a single arm with a more refined type. However,
the tests were flawed because the select arms had the same type, meaning the
parsed select node did not have a less refined type than the arms. Fix this by
giving the arms different types. Use a block to directly show that
refinalization occurred instead of the cast that was there previously.

GSI previously only optimized globals whose types were the same as their
initializer's types to ensure the glboal types were equality comparable.
However, this is an overly conservative restriction because the global
can have any type up to eqref without causing problems. Update the
restriction to be more precise.

This will help the GSI tests continue working once `struct.new` is typed
as exact.
@tlively tlively requested a review from kripken May 14, 2025 21:12
According to their comments, these tests purported to show that refinalize was
run after optimizing a select to a single arm with a more refined type. However,
the tests were flawed because the select arms had the same type, meaning the
parsed select node did not have a less refined type than the arms. Fix this by
giving the arms different types. Use a block to directly show that
refinalization occurred instead of the cast that was there previously.
@tlively tlively force-pushed the fix-opt-inst-select-test branch from 16407f3 to ac5354e Compare May 14, 2025 21:14
Base automatically changed from gsi-eq to main May 14, 2025 23:05
@tlively tlively merged commit 2bef62a into main May 14, 2025
14 checks passed
@tlively tlively deleted the fix-opt-inst-select-test branch May 14, 2025 23:31
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