-
Notifications
You must be signed in to change notification settings - Fork 294
Add new pass, linear-ctrl-form #853
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
Conversation
bf18dd0 to
e779389
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
19cdbe5 to
41989ba
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
41989ba to
c2326cc
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
c2326cc to
1f2378a
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
6218a04 to
b90a444
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
b90a444 to
9912249
Compare
782a379 to
fa1c3cd
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
fa1c3cd to
3e7ee94
Compare
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.
LGTM 👍
3e7ee94 to
6918606
Compare
This pass converts the "value semantics" form of the quake dialect from
the "pruned control relations" form to the "linear control relations"
form. The pruned form is the less constrained IR representation while
the latter is overly constrained. The following examples illustrate the
distinction.
This is a sequence of ctrl-x ops in pruned form:
%10 = quake.to_ctrl %0 : (!quake.wire) -> !quake.control
%11 = quake.x [%10] %1 : (!quake.control, !quake.wire) -> !quake.wire
%12 = quake.x [%10] %2 : (!quake.control, !quake.wire) -> !quake.wire
%13 = quake.x [%10] %3 : (!quake.control, !quake.wire) -> !quake.wire
%14 = quake.x [%10] %4 : (!quake.control, !quake.wire) -> !quake.wire
%15 = quake.x [%10] %5 : (!quake.control, !quake.wire) -> !quake.wire
%16 = quake.x [%10] %6 : (!quake.control, !quake.wire) -> !quake.wire
%17 = quake.x [%10] %7 : (!quake.control, !quake.wire) -> !quake.wire
%18 = quake.x [%10] %8 : (!quake.control, !quake.wire) -> !quake.wire
%19 = quake.x [%10] %9 : (!quake.control, !quake.wire) -> !quake.wire
%20 = quake.from_ctrl %10 : (!quake.control) -> !quake.wire
This is the same sequence in linear form:
%10:2 = quake.x [%0] %1 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%11:2 = quake.x [%10#0] %2 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%12:2 = quake.x [%11#0] %3 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%13:2 = quake.x [%12#0] %4 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%14:2 = quake.x [%13#0] %5 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%15:2 = quake.x [%14#0] %6 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%16:2 = quake.x [%15#0] %7 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%17:2 = quake.x [%16#0] %8 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
%18:2 = quake.x [%17#0] %9 : (!quake.wire, !quake.wire) -> (!quake.wire, !quake.wire)
Notice that the pruned form makes it apparent that any permutation for
scheduling these operations is legal and should give the same result.
The linear form does not.
Reorganize the passes in the tablegen file, putting them back in
alphabetical order.
Add test.
Review comments.
6918606 to
c099fcd
Compare
This pass converts the "value semantics" form of the quake dialect from the "pruned control relations" form to the "linear control relations" form. The pruned form is the less constrained IR representation while the latter is overly constrained. The following examples illustrate the distinction.
This is a sequence of ctrl-x ops in pruned form:
This is the same sequence in linear form:
Notice that the pruned form makes it apparent that any permutation for scheduling these operations is legal and should give the same result. The linear form does not.
Reorganize the passes in the tablegen file, putting them back in alphabetical order.