Skip to content

Conversation

meg-gupta
Copy link
Contributor

Permit uses of alloc_box as base operand in a mark_dependence instruction in the AllocBoxToStack optimization.

rdar://150398673

@meg-gupta meg-gupta requested a review from eeckstein as a code owner May 20, 2025 12:21
@meg-gupta
Copy link
Contributor Author

This will not be cherry-picked to release/6.2.

@meg-gupta
Copy link
Contributor Author

@swift-ci test

@meg-gupta meg-gupta requested a review from atrick May 20, 2025 12:22
@@ -739,6 +746,14 @@ static bool rewriteAllocBoxAsAllocStack(AllocBoxInst *ABI) {
continue;
}

if (auto *oldMDI = dyn_cast<MarkDependenceInst>(User)) {
auto *newMDI = SILBuilderWithScope(oldMDI).createMarkDependence(
oldMDI->getLoc(), oldMDI->getValue(), StackBox,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe need to replace the value instead of the mark_dependence base. And would be worth checking the replacement in the unit test.

@eeckstein
Copy link
Contributor

You need to make this change in AllocBoxToStack.swift

@meg-gupta
Copy link
Contributor Author

#82853 addresses this

@meg-gupta meg-gupta closed this Jul 8, 2025
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.

3 participants