Skip to content

[SILOptimizer] Eliminate dead alloc_pack #66638

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

Closed
wants to merge 2 commits into from

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Jun 14, 2023

This is very rudimentary support for eliminating dead packs.

add trivial tuple example
// CHECK: bb0:
// CHECK-NEXT: %0 = alloc_pack $Pack{TrivialDestructor, TrivialDestructor}
public func makeTrivialDestructorTuple() {
makeTuple(TrivialDestructor(), TrivialDestructor())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this also a case that should be eliminated? It seems we make 2 packs to pass to makeTuple, but we also consider this pack to be non-trivial.. is that correct?

@Azoy
Copy link
Contributor Author

Azoy commented Jun 14, 2023

@swift-ci please test

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.

Basically LGTM.
Can you also add a SIL test? E.g. in test/SILOptimizer/dead_alloc_elim.sil

@Azoy
Copy link
Contributor Author

Azoy commented Jun 21, 2023

@swift-ci please test

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!

@Azoy
Copy link
Contributor Author

Azoy commented Jun 27, 2023

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Jul 5, 2023

@swift-ci please clean test

@Azoy Azoy closed this Dec 31, 2023
@Azoy Azoy deleted the doe-alloc-pack branch December 31, 2023 19:31
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