-
Notifications
You must be signed in to change notification settings - Fork 25
feat: InlineFunctionsPass supports "Always" annotation that errors if unsatisfiable #1449
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
Open
acl-cqc
wants to merge
44
commits into
main
Choose a base branch
from
acl/inline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
05e3fb5
WIP add inlining annotation + pass
acl-cqc 51a4e89
tests
acl-cqc 9e9e722
Simplify cycle check, only need first cycle
acl-cqc 30d924f
inline always funcs leaves first
acl-cqc ef247fe
Respect entrypoint? Oooph!
acl-cqc 2a70f5b
Strange derive_more, make compile
acl-cqc 865b6dd
Don't RemDeadFuncs (be selective); skip cycles for only-called-once
acl-cqc 4ad40ea
Fix test: inlined func is removed
acl-cqc 896e36a
TODO test entrypoint_scope
acl-cqc 07871d5
cycles return iter, clippy
acl-cqc 849bf73
more TODOs
acl-cqc eecf9b7
rm doclink
acl-cqc d1d1615
Merge remote-tracking branch 'origin/main' into acl/inline
acl-cqc 1dd388a
Move annotation
acl-cqc c25a2cd
Remove only-called-once, simplify test
acl-cqc 2bd976d
Simplify, clarify/comment
acl-cqc 6fd9f0e
simplify: inline do_inline
acl-cqc 5bbabec
renaming, re-export
acl-cqc 0e3ad97
entrypoint_scope test
acl-cqc 9fd49cf
test cycle of one always and one not
acl-cqc 66e02c1
Add python (needs test)
acl-cqc 677e48e
clippy
acl-cqc 9284958
doc
acl-cqc 312f07b
fmt + missing,
acl-cqc dbcf612
first python test
acl-cqc 4554462
test failure, fiddling with imports, including type: ignore
acl-cqc 8151e43
ruff format
acl-cqc a521495
improve tket-py rs comment
acl-cqc ce8d5b7
Declare InlineAlwaysError in passes.pyi
acl-cqc cb98230
Merge remote-tracking branch 'origin/main' into acl/inline
acl-cqc f5eeaca
fix hashiter lint
acl-cqc c955955
update py metadata and improve test
acl-cqc ea67492
Merge remote-tracking branch 'origin/main' into acl/inline
acl-cqc 516749f
Move InlineAlways into InlineFuncs (first), transferring tests
acl-cqc 8c7d299
do less if not removing functions, test avoid RemoveDeadFuncs
acl-cqc cec5bf8
revert/update python bindings (AI-powered)
acl-cqc 96e4173
InlineAnnotation: update doc + from_json
acl-cqc 4ac8c4d
Revert change to doc comment, acyclic still correct
acl-cqc c7d1290
Drop commented-out code
acl-cqc db049d2
more thorough in-scope
acl-cqc d4d298a
tket-py use typed Metadata API (thanks Agustin)
acl-cqc 566dc2b
format rust imports
acl-cqc 421ca89
move new enum member to preserve position
acl-cqc 489d479
Properly handle LoadFunction..need tests
acl-cqc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,10 @@ impl Metadata for MaxQubitsHint { | |
| #[serde(rename_all = "snake_case")] | ||
| #[non_exhaustive] | ||
| pub enum InlineAnnotation { | ||
| /// Always inline calls to this function. | ||
| /// | ||
| /// If this cannot be done, an error will be raised. | ||
|
acl-cqc marked this conversation as resolved.
Outdated
|
||
| Always, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The semver checks are failing because this was added before all existing variants, and changed their inner tag id. Can you move the new variant to the end? Always = 2,
BestEffort = 0, |
||
| /// Inline the function if we know it won't produce an invalid Hugr. | ||
| /// | ||
| /// This is a best effort option; the compiler may choose not to inline | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.