-
-
Notifications
You must be signed in to change notification settings - Fork 63
✨ Add Dead Gate Elimination Pattern #1755
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
DRovara
wants to merge
27
commits into
main
Choose a base branch
from
mlir/dead-gate-elimination
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 22 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
91b3ef9
feat(mlir): :sparkles: implement dead gate elimination canonicalizati…
DRovara ba57aa2
fix(mlir): :bug: fix tests
DRovara b83afab
test(mlir): :white_check_mark: add direct test for dead gate elimination
DRovara 4243ac0
docs(mlir): :memo: update changelog
DRovara a50032b
style(mlir): :rotating_light: fix linter issues
DRovara d8c9ad5
fix(mlir): :recycle: guard RegionOp removal for child oeprations with…
DRovara 9717547
fix(mlir): :bug: fix handling for `IfOp` removal and add specialized …
DRovara 2d65418
fix(mlir): :bug: minor bug and code style fixes
DRovara 278a54e
style(mlir): :rotating_light: fix linter issues on includes
DRovara 44eaf7e
fix: :pencil2: fix typo in changelog
DRovara 8b3af43
🎨 Optimize `checkAndRemoveDeadGate` function
burgholzer 6998110
📝 Add to generic changelog entry for mqt-cc
burgholzer d56ccaf
Update mlir/lib/Dialect/QCO/IR/Operations/ResetOp.cpp
DRovara fb9fffb
🎨 pre-commit fixes
pre-commit-ci[bot] 44f295a
test(mlir): :white_check_mark: improve test and add custom return typ…
DRovara 9e8e711
Merge branch 'mlir/dead-gate-elimination' of github.com:munich-quantu…
DRovara b6cbf8e
style(mlir): :recycle: remove unneeded dumps
DRovara dee0752
style(mlir): :recycle: move `checkAndRemoveDeadGate` implementation o…
DRovara 244f8bb
style(mlir): :recycle: implement helper function to check if a gate i…
DRovara 6eaac40
style(mlir): :rotating_light: fix includes
DRovara 07a3f4d
docs(mlir): :memo: add comments to document `gphase` operation as mem…
DRovara cab4155
test(mlir): :white_check_mark: update tests to now use return values
DRovara 6f1c64e
Update mlir/include/mlir/Dialect/QCO/QCOUtils.h
DRovara 7e63992
Update mlir/unittests/Dialect/QCO/IR/test_qco_ir.cpp
DRovara 2e9f4e6
Update mlir/unittests/programs/qco_programs.cpp
DRovara 29b0cbe
Update mlir/unittests/programs/qco_programs.h
DRovara 225c88f
style(mlir): :recycle: address some review comments
DRovara 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without having thought about it too much right now, is there still a real need for the old
build()method, or should any real QCO program return something (other than the exit code)? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I didn't feel confident enough to remove the original
buildfunction.I can imagine scenarios where it would still be useful, the question is just (1) are they valid/important enough? and (2) are they maybe that rare that users could just use
buildWithReturnwith a function pointer that just returns an empty type range or a single ì64` exit code instead?Example:
A program that is supposed to be translated down to QIR and should then run the
record_outputs(don't remember the exact name) operation. Or, if that's what the new returns will be translated into, then maybe programs with intermediate print operations.In any case, I have no problem with just removing the original
buildmethod, but I feel like that should be your call.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be fine with dropping the original build method. One can always emulate it with the existing builder by returning an exit code. So the new builder is strictly more expressive.
Edit: the return values of entry point functions will be translated to output recording calls in QIR.