Skip to content

[sil-combine] Enable dead alloc_ref elim for ossa. #35182

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

gottesmm
Copy link
Contributor

It was just looking for an alloc_ref that only has dealloc_ref,
set_deallocating, fix_lifetime users.

It was just looking for an alloc_ref that only has dealloc_ref,
set_deallocating, fix_lifetime users.
@gottesmm gottesmm requested review from atrick and meg-gupta December 21, 2020 21:07
if (AR->getFunction()->hasOwnership())
return nullptr;

if (!AR)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why this check is here. Seems like a mistake. A visitor should never be passing in a null value.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke 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. If the plan is to have multiple test files for sil-combine, maybe a new folder like test/SILOptimizer/SILCombine will be useful in the future.

@gottesmm
Copy link
Contributor Author

I was thinking about that. I want to make sure @atrick is cool with it first.

@gottesmm gottesmm merged commit 75814e9 into swiftlang:main Dec 21, 2020
@gottesmm gottesmm deleted the pr-c252916df0109f89d79567d71f8772ba7a2fdb73 branch December 21, 2020 23:32
@atrick
Copy link
Contributor

atrick commented Dec 22, 2020

@gottesmm @meg-gupta fyi, it's fine to eliminate fix_lifetime when the object is uniquely identified and there are no other uses, which is indeed the case here for alloc_ref. There are other places where we delete "dead" fix_lifetime instructions that are not uniquely referenced, which is definitely incorrect.

I have no problem with the test subdirectories matching the source subdirectories.

@gottesmm
Copy link
Contributor Author

Ok. SGTM! I was just porting. I am trying to slim down my large patch.

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