Skip to content

[SILOptimizer] Disable SILCombiner::visitPartialApplyInst for method callees. #30877

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
merged 2 commits into from
Apr 8, 2020

Conversation

dan-zheng
Copy link
Contributor

Disable SILCombiner::visitPartialApplyInst from rewriting partial_apply with
with @convention(method) callee to thin_to_thick_function.

This fixes SIL verification errors: thin_to_thick_function only supports
@convention(thin) operands.

Resolves SR-12548.


Unblocks #30875.

Context: the differentiation transform (VJPEmitter::visitApply) generates partial_apply with substitutions without arguments to polymorphic function references. With -O, some of these references are specialized, leading to the case above (partial_apply of @convention(method) callee without substitutions or arguments).

Test SR-12548: `SILCombiner::visitPartialApplyInst` rewrites `partial_apply`
with `@convention(method)` callee to `thin_to_thick_function`.

This produces a SIL verification error: `thin_to_thick_function` only supports
`@convention(thin)` operands.
@dan-zheng
Copy link
Contributor Author

@atrick: could you please review, as a SILOptimizer code owner?

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

…d callees.

Disable `SILCombiner::visitPartialApplyInst` from rewriting `partial_apply` with
with `@convention(method)` callee to `thin_to_thick_function`.

This fixes SIL verification errors: `thin_to_thick_function` only supports
`@convention(thin)` operands.

Resolves SR-12548.
@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 8, 2020

Build failed
Swift Test Linux Platform
Git Sha - 3a852159ceb13a5fa61ba1573744214fc69a9d34

@swift-ci
Copy link
Contributor

swift-ci commented Apr 8, 2020

Build failed
Swift Test OS X Platform
Git Sha - 3a852159ceb13a5fa61ba1573744214fc69a9d34

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test macOS

@dan-zheng dan-zheng requested review from marcrasi and rxwei April 8, 2020 21:03
@dan-zheng
Copy link
Contributor Author

@jckarter commented that this change makes sense.

Creating thin_to_thick_function with a @convention(method) operand doesn't make sense because @convention(thin) and @convention(method) are not compatible.

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