diff --git a/mlir/test/Quantum/SplitMultipleTapesTest.mlir b/mlir/test/Quantum/SplitMultipleTapesTest.mlir index 51262d0602..a0c024eb6e 100644 --- a/mlir/test/Quantum/SplitMultipleTapesTest.mlir +++ b/mlir/test/Quantum/SplitMultipleTapesTest.mlir @@ -102,40 +102,40 @@ module @circuit_twotapes_module { // CHECK: func.call @circuit_twotapes_tape_1(%arg1, %arg0, %cst) // CHECK: {{%.+}} = stablehlo.subtract {{%.+}}, {{%.+}} : tensor -// CHECK: func.func private @circuit_twotapes_tape_0(%arg0: tensor, %arg1: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} -// CHECK: quantum.device -// CHECK: {{%.+}} = stablehlo.add %arg0, %arg1 : tensor -// CHECK: quantum.device_release -// CHECK: return {{%.+}} : tensor -// CHECK-NEXT: } - -// CHECK: func.func private @circuit_twotapes_tape_1(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} -// CHECK: quantum.device -// CHECK: tensor.extract %arg0[] -// CHECK: {{%.+}} = stablehlo.multiply %arg1, %arg2 : tensor -// CHECK: quantum.device_release -// CHECK: return {{%.+}} : tensor -// CHECK-NEXT: } +// CHECK-DAG: func.func private @circuit_twotapes_tape_0(%arg0: tensor, %arg1: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} +// CHECK-DAG: quantum.device +// CHECK-DAG: [[retAdd:%.+]] = stablehlo.add %arg0, %arg1 : tensor +// CHECK-DAG: quantum.device_release +// CHECK-DAG: return [[retAdd]] : tensor +// CHECK-DAG: } + +// CHECK-DAG: func.func private @circuit_twotapes_tape_1(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} +// CHECK-DAG: quantum.device +// CHECK-DAG: tensor.extract %arg0[] +// CHECK-DAG: [[retMult:%.+]] = stablehlo.multiply %arg1, %arg2 : tensor +// CHECK-DAG: quantum.device_release +// CHECK-DAG: return [[retMult]] : tensor +// CHECK-DAG: } // CHECK: func.func private @circuit_twotapes_doppleganger // CHECK: func.call @circuit_twotapes_doppleganger_tape_0(%arg1, %cst_0) // CHECK: func.call @circuit_twotapes_doppleganger_tape_1(%arg1, %arg0, %cst) // CHECK: {{%.+}} = stablehlo.subtract {{%.+}}, {{%.+}} : tensor -// CHECK: func.func private @circuit_twotapes_doppleganger_tape_0(%arg0: tensor, %arg1: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} -// CHECK: quantum.device -// CHECK: {{%.+}} = stablehlo.add %arg0, %arg1 : tensor -// CHECK: quantum.device_release -// CHECK: return {{%.+}} : tensor -// CHECK-NEXT: } - -// CHECK: func.func private @circuit_twotapes_doppleganger_tape_1(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} -// CHECK: quantum.device -// CHECK: tensor.extract %arg0[] -// CHECK: {{%.+}} = stablehlo.multiply %arg1, %arg2 : tensor -// CHECK: quantum.device_release -// CHECK: return {{%.+}} : tensor -// CHECK-NEXT: } +// CHECK-DAG: func.func private @circuit_twotapes_doppleganger_tape_0(%arg0: tensor, %arg1: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} +// CHECK-DAG: quantum.device +// CHECK-DAG: [[retAddDop:%.+]] = stablehlo.add %arg0, %arg1 : tensor +// CHECK-DAG: quantum.device_release +// CHECK-DAG: return [[retAddDop]] : tensor +// CHECK-DAG: } + +// CHECK-DAG: func.func private @circuit_twotapes_doppleganger_tape_1(%arg0: tensor, %arg1: tensor, %arg2: tensor) -> tensor attributes {diff_method = "parameter-shift", llvm.linkage = #llvm.linkage, qnode} +// CHECK-DAG: quantum.device +// CHECK-DAG: tensor.extract %arg0[] +// CHECK-DAG: [[retMultDop:%.+]] = stablehlo.multiply %arg1, %arg2 : tensor +// CHECK-DAG: quantum.device_release +// CHECK-DAG: return [[retMultDop]] : tensor +// CHECK-DAG: } // CHECK: }