Skip to content
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

IRGen: fix a wrong tail-call attribute in a partial apply forwarder #15829

Merged
merged 1 commit into from
Apr 9, 2018

Conversation

eeckstein
Copy link
Member

When an alloca'd memory is passed to a function it must not be a tail call, because otherwise llvm's dead store elimination would eliminate all stores to it.

rdar://problem/39250070

When an alloca'd memory is passed to a function it must not be a tail call, because otherwise llvm's dead store elimination would eliminate all stores to it.

rdar://problem/39250070
@eeckstein
Copy link
Member Author

@swift-ci smoke test and merge

Copy link
Member

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@slavapestov
Copy link
Member

Nice catch! For the master branch, can you maybe factor out a wrapper around createAllocas that sets needsAllocas to true, so that we don't forget to do it anywhere else?

@eeckstein
Copy link
Member Author

@swift-ci smoke test macOS

@eeckstein eeckstein merged commit bceaab3 into apple:master Apr 9, 2018
@eeckstein eeckstein deleted the fix-pa-forwarder branch April 9, 2018 21:42
@eeckstein
Copy link
Member Author

@slavapestov I experimented a bit but it turned out to be not so easy, because some alloca's are created in nested functions and not all alloca's are relevant for this check (because the memory is not actually used in the call).

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.

None yet

3 participants