Closed 1tnguyen closed 3 years ago
Unrolling affine for
loops is not enough for circuit optimization. Need a way to consolidate SSA values created by q.extract
.
e.g.,
affine.for %arg0 = 0 to 8 step 4 {
%2 = q.extract(%0, %c0_i64) : !quantum.Qubit
%3 = qvs.x(%2) : !quantum.Qubit
%4 = q.extract(%0, %c0_i64) : !quantum.Qubit
%5 = qvs.x(%4) : !quantum.Qubit
%6 = q.extract(%0, %c0_i64) : !quantum.Qubit
%7 = qvs.x(%6) : !quantum.Qubit
%8 = q.extract(%0, %c0_i64) : !quantum.Qubit
%9 = qvs.x(%8) : !quantum.Qubit
}
This will enable the built-in MLIR loop unrolling pass.