-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[region-isolation]fix crash due to missing VectorBaseAddrInst case #81591
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
@swift-ci smoke test |
@@ -312,6 +312,7 @@ static bool isStaticallyLookThroughInst(SILInstruction *inst) { | |||
case SILInstructionKind::UncheckedEnumDataInst: | |||
case SILInstructionKind::StructElementAddrInst: | |||
case SILInstructionKind::TupleElementAddrInst: | |||
case SILInstructionKind::VectorBaseAddrInst: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you need to add a visitor case below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it was already added below. The best way to make sure this does not happen in the future is for people to add a test in https://github.com/swiftlang/swift/blob/main/test/Concurrency/regionanalysis_trackable_value.sil. Can you add a test case for this there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the advice.
I have added a test based on the debug log, but it does not reproduce the issue.
Could you suggest what kind of test I should add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add that test... then LGTM.
@@ -312,6 +312,7 @@ static bool isStaticallyLookThroughInst(SILInstruction *inst) { | |||
case SILInstructionKind::UncheckedEnumDataInst: | |||
case SILInstructionKind::StructElementAddrInst: | |||
case SILInstructionKind::TupleElementAddrInst: | |||
case SILInstructionKind::VectorBaseAddrInst: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it was already added below. The best way to make sure this does not happen in the future is for people to add a test in https://github.com/swiftlang/swift/blob/main/test/Concurrency/regionanalysis_trackable_value.sil. Can you add a test case for this there.
@stzn Can you rebase. I want to land this ASAP. This got reported to me in another place and I want to get this into 6.2. |
Also, the test was done incorrectly. You want to do a debug_value [trace] on %2. |
2e5d758
to
b4b8159
Compare
Thank you. |
b4b8159
to
c9e70b7
Compare
@stzn the test shows that something is missing in your implementation. We should look through the vector_base_addr if it is look through. |
Resolves #81534
It seems we are missing the case for
VectorBaseAddrInst
.VectorBaseAddrInst
is statically defined asLookThrough
.swift/lib/SILOptimizer/Analysis/RegionAnalysis.cpp
Line 3414 in d985bf6
Regarding tests, similar problems could arise when new
LookThrough
instructions are added in the future. To prevent this, we should consider finding a way to ensure allLookThrough
instructions are properly handled inisStaticallyLookThroughInst
. What do you think? Are there any other places that do something similar?