@@ -89,7 +89,7 @@ class FluxOp<string mnemonic, list<Trait> traits = []> :
8989// Resource Operations
9090//===----------------------------------------------------------------------===//
9191
92- def AllocOp : FluxOp<"alloc"> {
92+ def AllocOp : FluxOp<"alloc", [MemoryEffects<[MemAlloc]>] > {
9393 let summary = "Allocate a qubit dynamically";
9494 let description = [{
9595 Allocates a new qubit dynamically and returns an SSA value representing it.
@@ -137,7 +137,7 @@ def AllocOp : FluxOp<"alloc"> {
137137 let hasVerifier = 1;
138138}
139139
140- def DeallocOp : FluxOp<"dealloc"> {
140+ def DeallocOp : FluxOp<"dealloc", [MemoryEffects<[MemFree]>] > {
141141 let summary = "Deallocate a qubit";
142142 let description = [{
143143 Deallocates a qubit, releasing its resources.
@@ -153,7 +153,7 @@ def DeallocOp : FluxOp<"dealloc"> {
153153 let hasCanonicalizer = 1;
154154}
155155
156- def StaticOp : FluxOp<"static"> {
156+ def StaticOp : FluxOp<"static", [Pure] > {
157157 let summary = "Retrieve a static qubit by index";
158158 let description = [{
159159 The `flux.static` operation produces an SSA value representing a qubit
@@ -198,7 +198,7 @@ def MeasureOp : FluxOp<"measure"> {
198198 ```
199199 }];
200200
201- let arguments = (ins QubitType:$qubit_in,
201+ let arguments = (ins Arg< QubitType, "the qubit to measure", [MemRead]> :$qubit_in,
202202 OptionalAttr<StrAttr>:$register_name,
203203 OptionalAttr<ConfinedAttr<I64Attr, [IntPositive]>>:$register_size,
204204 OptionalAttr<ConfinedAttr<I64Attr, [IntNonNegative]>>:$register_index);
@@ -230,7 +230,7 @@ def ResetOp : FluxOp<"reset", [Idempotent, SameOperandsAndResultType]> {
230230 ```
231231 }];
232232
233- let arguments = (ins QubitType:$qubit_in);
233+ let arguments = (ins Arg< QubitType, "the qubit to reset", [MemRead]> :$qubit_in);
234234 let results = (outs QubitType:$qubit_out);
235235 let assemblyFormat = "$qubit_in attr-dict `:` type($qubit_in) `->` type($qubit_out)";
236236 let hasCanonicalizer = 1;
0 commit comments