OpenQASM3/MLIR: SSA value chain with qreg alias/slicing
Created by: tnguyen-ornl
Example
OPENQASM 3;
include "qelib1.inc";
qubit q[6];
let myreg = q[1, 3, 5];
x q[1];
t myreg[0];
x q[1];
MLIR (simplified)
%2 = q.extract(%0, %c1_i64) : !quantum.Qubit
%3 = qvs.x(%2) : !quantum.Qubit
%4 = q.extract(%1, %c0_i64) : !quantum.Qubit
%5 = qvs.t(%4) : !quantum.Qubit
%6 = qvs.x(%3) : !quantum.Qubit
This is buggy: two X gates become SSA-connected (%3
) incorrectly.