Skip to content

[OpaqueValues] Small fixes for AddressLowering. #61897

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

Conversation

nate-chandler
Copy link
Contributor

  • Allow deletion of alloc_stacks for which dealloc_stacks have been created.
  • Handle the fix_lifetime instruction.

Based on #61893 .

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test macOS platform

@@ -23,6 +23,8 @@ static bool hasOnlyIncidentalUses(SILInstruction *inst,
for (SILValue result : inst->getResults()) {
for (Operand *use : result->getUses()) {
SILInstruction *user = use->getUser();
if (isa<DeallocStackInst>(user) && isa<AllocStackInst>(inst))
Copy link
Contributor

Choose a reason for hiding this comment

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

Deleting an alloc_stack is supposed to be handled by isScopeAffectingInstructionDead. We cannot remove alloc_stack at -Onone without checking varInfo

Before iterating over an instruction's uses and deleting each, cache the
list of uses.  Otherwise, the for loop stops after the first instruction
when it's deleted (and has its NextUse field cleared).
@nate-chandler nate-chandler force-pushed the opaque-values/3/20221102 branch from 898abb9 to 646cf23 Compare November 4, 2022 00:17
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

!

@nate-chandler nate-chandler marked this pull request as ready for review November 4, 2022 14:02
@nate-chandler nate-chandler merged commit 2a8b2ce into swiftlang:main Nov 4, 2022
@nate-chandler nate-chandler deleted the opaque-values/3/20221102 branch November 4, 2022 14:02
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