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

support private funcs in wrap-generic #1310

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

j2kun
Copy link
Collaborator

@j2kun j2kun commented Jan 25, 2025

Similar to #1309, support func.call in wrap-generic.

This supports the type-conversion part of wrap-generic for an external function def, as well as supporting a non-{secret.secret} external func which is called inside a func that is wrap-generic'ed.

One thing this doesn't support yet is handling an external func that is annotated as secret, that is also called from a func that is annotated as secret. This will produce an error because it will put the func.call in a secret.generic while the func is type-converted to have secret operands and results.

If we need this (followup work), which I'm not sure we do, we would have to have wrap-generic split the generic op at the func.call site, or else defer the conversion of the external signature to secret-to-scheme, which is how we will handle the case (supported by this PR) where the external func is not annotated with secret.secret

@j2kun j2kun force-pushed the wrap-generic-func-call branch from 7b9c1d9 to 05f422c Compare January 27, 2025 05:01
Comment on lines +7 to +8
// CHECK: private @some_func2(!secret.secret<i1>) -> !secret.secret<i1>
func.func private @some_func2(i1 {secret.secret}) -> i1
Copy link
Collaborator

Choose a reason for hiding this comment

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

What was the purpose of this func for the testcase?

@asraa asraa added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jan 27, 2025
@copybara-service copybara-service bot merged commit 0923c76 into google:main Jan 27, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants