Skip to content

[semantic-arc] Ignore type dependent uses when using a worklist to check for writes. #38301

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

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Jul 7, 2021

Otherwise, we hit misc crashes. The worklist should have always been filtering
these. I wonder why we have never hit this issue before.

I added a new API that filters out type dependent uses called
ValueBase::getNonTypeDependentUses() to make it easier to perform def->use
worklist traversal ignoring these uses. This mirrors the APIs that we have
created for filtering type dependent operands when performing use->def worklist
traversal.

I also noticed that we are not eliminating a load [copy] that we could in the
test case. I am going to file a separate bug report for that work.

rdar://79781943

…eck for writes.

Otherwise, we hit misc crashes. The worklist should have always been filtering
these. I wonder why we have never hit this issue before.

I added a new API that filters out type dependent uses called
ValueBase::getNonTypeDependentUses() to make it easier to perform def->use
worklist traversal ignoring these uses. This mirrors the APIs that we have
created for filtering type dependent operands when performing use->def worklist
traversal.

I also noticed that we are not eliminating a load [copy] that we could in the
test case. I am going to file a separate bug report for that work.

rdar://79781943
@gottesmm gottesmm requested a review from meg-gupta July 7, 2021 23:00
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 7, 2021

@swift-ci test

Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

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

LGTM. But worth checking if type dependent operands are all tail allocated. May make ValueBase::non_typedependent_use_begin slightly faster.

@meg-gupta
Copy link
Contributor

@gottesmm LGTM. Thanks for clarifying about type dependent uses.

@gottesmm gottesmm merged commit e627318 into swiftlang:main Jul 8, 2021
@gottesmm gottesmm deleted the pr-1940e29e0863674e4e97f4bbc5a0a5dbe80eda40 branch July 8, 2021 22:04
@gottesmm
Copy link
Contributor Author

gottesmm commented Jul 8, 2021

No problem! 5.5 cherry-pick incoming!

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