@@ -276,7 +276,7 @@ namespace {
276276 * QC uses reference semantics and does not enforce linear typing for qubits.
277277 * After conversion, QCO requires that every qubit SSA value is consumed
278278 * exactly once. For allocations (including static qubits), the sink is
279- * `qco.dealloc `. This pattern inserts `qco.dealloc ` operations for all
279+ * `qco.sink `. This pattern inserts `qco.sink ` operations for all
280280 * still-live qubits tracked in the lowering state right before the return.
281281 */
282282struct ConvertFuncReturnOp final : StatefulOpConversionPattern<func::ReturnOp> {
@@ -319,7 +319,7 @@ struct ConvertFuncReturnOp final : StatefulOpConversionPattern<func::ReturnOp> {
319319 llvm::sort (liveQubitsSorted, SSAOrder{});
320320
321321 for (Value qubit : liveQubitsSorted) {
322- qco::DeallocOp ::create (rewriter, op.getLoc (), qubit);
322+ qco::SinkOp ::create (rewriter, op.getLoc (), qubit);
323323 }
324324
325325 state.qubitMap .erase (funcRegion);
@@ -397,18 +397,18 @@ struct ConvertQCAllocOp final : StatefulOpConversionPattern<qc::AllocOp> {
397397};
398398
399399/* *
400- * @brief Converts qc.dealloc to qco.dealloc
400+ * @brief Converts qc.dealloc to qco.sink
401401 *
402402 * @details
403403 * Deallocates a qubit by looking up its latest QCO value and creating
404- * a corresponding qco.dealloc operation. The mapping is removed from
404+ * a corresponding qco.sink operation. The mapping is removed from
405405 * the state as the qubit is no longer in use.
406406 *
407407 * Example transformation:
408408 * ```mlir
409409 * qc.dealloc %q : !qc.qubit
410410 * // becomes (where %q maps to %q_final):
411- * qco.dealloc %q_final : !qco.qubit
411+ * qco.sink %q_final : !qco.qubit
412412 * ```
413413 */
414414struct ConvertQCDeallocOp final : StatefulOpConversionPattern<qc::DeallocOp> {
@@ -424,8 +424,8 @@ struct ConvertQCDeallocOp final : StatefulOpConversionPattern<qc::DeallocOp> {
424424 Value qcQubit = op.getQubit ();
425425 Value qcoQubit = lookupMappedQubit (state, operation, qcQubit);
426426
427- // Create the dealloc operation
428- rewriter.replaceOpWithNewOp <qco::DeallocOp >(op, qcoQubit);
427+ // Create the sink operation
428+ rewriter.replaceOpWithNewOp <qco::SinkOp >(op, qcoQubit);
429429
430430 // Remove from state as qubit is no longer in use
431431 qubitMap.erase (qcQubit);
@@ -1130,7 +1130,7 @@ struct QCToQCO final : impl::QCToQCOBase<QCToQCO> {
11301130 // Conversion of qc types in func.return
11311131 //
11321132 // Note: `func.return` may already be type-legal even though we still need
1133- // to insert sink operations (`qco.dealloc `) for remaining live
1133+ // to insert sink operations (`qco.sink `) for remaining live
11341134 // qubits. Therefore, we make it dynamically illegal unless the lowering
11351135 // state has no remaining qubits.
11361136 patterns.add <ConvertFuncReturnOp>(typeConverter, context, &state);
0 commit comments