Skip to content

[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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stzn
Copy link
Contributor

@stzn stzn commented May 18, 2025

Resolves #81534

It seems we are missing the case for VectorBaseAddrInst.

VectorBaseAddrInst is statically defined as LookThrough.

CONSTANT_TRANSLATION(VectorBaseAddrInst, LookThrough)

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 all LookThrough instructions are properly handled in isStaticallyLookThroughInst. What do you think? Are there any other places that do something similar?

@stzn stzn requested review from ktoso and eeckstein as code owners May 18, 2025 11:26
Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@eeckstein eeckstein requested a review from gottesmm May 19, 2025 06:29
@eeckstein
Copy link
Contributor

@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:
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gottesmm

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?

Copy link
Contributor

@gottesmm gottesmm left a 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:
Copy link
Contributor

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.

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.

The main-snapshot-2025-05-14 compiler can't compile InlineArray
3 participants