-
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.
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.
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?