Skip to content

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Jun 5, 2024

#54323 ensures that all frames within a cycle have the
same, cycle valid effects. However, src.ssaflags is calculated using
partial effects, so when the effects of a frame within the cycle are
updated, there would be an inconsistency between frame.ipo_effects and
frame.src.ssaflags. Due to this inconsistency, #54323
breaks the test cases from #51092, when backported to
v1.11. On the surface this is because #52999 hasn't been
backported to v1.11, but the fundamental issue lies in this
inconsistency between cycle effects and ssaflags.

To resolve this issue, this commit traverses cycle_backedges to visit
statements involved in the cycle, and updates each ssaflags according
to new cycle valid effects if necessary.

@aviatesk aviatesk added compiler:inference Type inference backport 1.11 Change should be backported to release-1.11 labels Jun 5, 2024
@aviatesk aviatesk requested a review from vtjnash June 5, 2024 16:59
@aviatesk aviatesk force-pushed the avi/override-ssaflags-54323 branch from 878ca04 to b7ac60a Compare June 6, 2024 02:17
@vtjnash
Copy link
Member

vtjnash commented Jun 6, 2024

We do already have a list of the back edges and their statement numbers. Would it be easier to walk that list instead?

@aviatesk
Copy link
Member Author

aviatesk commented Jun 6, 2024

My understanding is that this PR does that (specifically, traversing stmt_edges), or is this a slightly different idea?

@aviatesk aviatesk force-pushed the avi/override-ssaflags-54323 branch from b7ac60a to c9a5560 Compare June 6, 2024 08:13
@vtjnash
Copy link
Member

vtjnash commented Jun 6, 2024

I was referencing cycle_backedges, since that is already a filtered list of every ip in the cycle (though possibly pointing in the reverse direction from what you wanted here)

@aviatesk aviatesk force-pushed the avi/override-ssaflags-54323 branch from c9a5560 to 73d4077 Compare June 6, 2024 13:46
@vtjnash
Copy link
Member

vtjnash commented Jun 6, 2024

LGTM, though may want to update the commit message now

@aviatesk
Copy link
Member Author

aviatesk commented Jun 6, 2024

I was referencing cycle_backedges, since that is already a filtered list of every ip in the cycle (though possibly pointing in the reverse direction from what you wanted here)

Thanks, that should be far more efficient.

@aviatesk
Copy link
Member Author

aviatesk commented Jun 6, 2024

Updated the PR description, and I will use it for an incoming commit description.

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Jun 6, 2024
#54323 ensures that all frames within a cycle have the
same, cycle valid effects. However, `src.ssaflags` is calculated using
partial effects, so when the effects of a `frame` within the cycle are
updated, there would be an inconsistency between `frame.ipo_effects` and
`frame.src.ssaflags`. Due to this inconsistency, #54323
breaks the test cases from #51092, when backported to
v1.11. On the surface this is because #52999 hasn't been
backported to v1.11, but the fundamental issue lies in this
inconsistency between cycle effects and `ssaflags`.

To resolve this issue, this commit traverses `cycle_backedges` to visit
statements involved in the cycle, and updates each `ssaflags` according
to new cycle valid effects if necessary.
@aviatesk aviatesk force-pushed the avi/override-ssaflags-54323 branch from 73d4077 to 8ac9368 Compare June 6, 2024 17:05
@aviatesk
Copy link
Member Author

aviatesk commented Jun 7, 2024

The abstractarray error occurring in test i686-w64-mingw32 seems to also be happening on master, so I will merge this as is.

@aviatesk aviatesk merged commit d71441b into master Jun 7, 2024
@aviatesk aviatesk deleted the avi/override-ssaflags-54323 branch June 7, 2024 02:14
aviatesk added a commit that referenced this pull request Jun 7, 2024
…#54689)

#54323 ensures that all frames within a cycle have the
same, cycle valid effects. However, `src.ssaflags` is calculated using
partial effects, so when the effects of a `frame` within the cycle are
updated, there would be an inconsistency between `frame.ipo_effects` and
`frame.src.ssaflags`. Due to this inconsistency, #54323
breaks the test cases from #51092, when backported to
v1.11. On the surface this is because #52999 hasn't been
backported to v1.11, but the fundamental issue lies in this
inconsistency between cycle effects and `ssaflags`.

To resolve this issue, this commit traverses `cycle_backedges` to visit
statements involved in the cycle, and updates each `ssaflags` according
to new cycle valid effects if necessary.
@aviatesk aviatesk mentioned this pull request Jun 7, 2024
60 tasks
@aviatesk aviatesk removed merge me PR is reviewed. Merge when all tests are passing backport 1.11 Change should be backported to release-1.11 labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:inference Type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants