diff --git a/mlir/include/mlir/Dialect/Func/IR/FuncOps.td b/mlir/include/mlir/Dialect/Func/IR/FuncOps.td --- a/mlir/include/mlir/Dialect/Func/IR/FuncOps.td +++ b/mlir/include/mlir/Dialect/Func/IR/FuncOps.td @@ -209,7 +209,7 @@ def FuncOp : Func_Op<"func", [ AffineScope, AutomaticAllocationScope, CallableOpInterface, - FunctionOpInterface, IsolatedFromAbove, Symbol + FunctionOpInterface, IsolatedFromAbove, OpAsmOpInterface, Symbol ]> { let summary = "An operation with a name containing a single `SSACFG` region"; let description = [{ @@ -308,6 +308,13 @@ /// Returns the result types of this function. ArrayRef getResultTypes() { return getFunctionType().getResults(); } + //===------------------------------------------------------------------===// + // OpAsmOpInterface Methods + //===------------------------------------------------------------------===// + + /// Allow the dialect prefix to be omitted. + static StringRef getDefaultDialect() { return "func"; } + //===------------------------------------------------------------------===// // SymbolOpInterface Methods //===------------------------------------------------------------------===// diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp --- a/mlir/lib/IR/Operation.cpp +++ b/mlir/lib/IR/Operation.cpp @@ -613,10 +613,6 @@ StringRef name = op->getName().getStringRef(); if (name.startswith((defaultDialect + ".").str())) name = name.drop_front(defaultDialect.size() + 1); - // TODO: remove this special case (and update test/IR/parser.mlir) - else if ((defaultDialect.empty() || defaultDialect == "builtin") && - name.startswith("func.")) - name = name.drop_front(5); p.getStream() << name; } diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -1646,11 +1646,6 @@ // default dialect (set through OpAsmOpInterface). opInfo = RegisteredOperationName::lookup( Twine(defaultDialect + "." + opName).str(), getContext()); - // FIXME: Remove this in favor of using default dialects. - if (!opInfo && getContext()->getOrLoadDialect("func")) { - opInfo = RegisteredOperationName::lookup(Twine("func." + opName).str(), - getContext()); - } if (opInfo) { dialect = &opInfo->getDialect(); opName = opInfo->getStringRef().str(); diff --git a/mlir/test/Analysis/test-liveness.mlir b/mlir/test/Analysis/test-liveness.mlir --- a/mlir/test/Analysis/test-liveness.mlir +++ b/mlir/test/Analysis/test-liveness.mlir @@ -211,7 +211,7 @@ // CHECK-NEXT: val_8 // CHECK-NEXT: %1 = arith.addi // CHECK-NEXT: scf.for - // CHECK: // return %1 + // CHECK: // func.return %1 // CHECK: EndLiveness %0 = arith.addi %arg3, %arg4 : i32 %1 = arith.addi %arg4, %arg5 : i32 @@ -245,7 +245,7 @@ // CHECK-NEXT: val_8 // CHECK-NEXT: %1 = arith.addi // CHECK-NEXT: scf.for - // CHECK: // return %1 + // CHECK: // func.return %1 // CHECK: EndLiveness %arg0 : index, %arg1 : index, %arg2 : index, %arg3 : i32, %arg4 : i32, %arg5 : i32, diff --git a/mlir/test/CAPI/ir.c b/mlir/test/CAPI/ir.c --- a/mlir/test/CAPI/ir.c +++ b/mlir/test/CAPI/ir.c @@ -387,7 +387,7 @@ fprintf(stderr, "Terminator: "); mlirOperationPrint(terminator, printToStderr, NULL); fprintf(stderr, "\n"); - // CHECK: Terminator: return + // CHECK: Terminator: func.return // Get the attribute by index. MlirNamedAttribute namedAttr0 = mlirOperationGetAttribute(operation, 0); @@ -1850,10 +1850,10 @@ int testSymbolTable(MlirContext ctx) { fprintf(stderr, "@testSymbolTable\n"); - const char *moduleString = "func private @foo()" - "func private @bar()"; - const char *otherModuleString = "func private @qux()" - "func private @foo()"; + const char *moduleString = "func.func private @foo()" + "func.func private @bar()"; + const char *otherModuleString = "func.func private @qux()" + "func.func private @foo()"; MlirModule module = mlirModuleCreateParse(ctx, mlirStringRefCreateFromCString(moduleString)); diff --git a/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir b/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir --- a/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir +++ b/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir @@ -658,14 +658,14 @@ iterator_types = ["parallel", "parallel"]} outs(%arg0 : tensor<1x8xf64>) { ^bb0(%a: f64): - %r = call @compute1(%a) : (f64) -> f64 + %r = func.call @compute1(%a) : (f64) -> f64 linalg.yield %r : f64 } -> tensor<1x8xf64> // CHECK-NEXT: %[[R:.*]] = linalg.generic // CHECK: bb0(%[[BBA:[0-9a-z]*]]: f64, %[[BBB:[0-9a-z]*]]: i32): - // CHECK-NEXT: %[[A:.*]] = call @compute1(%[[BBA]]) : (f64) -> f64 - // CHECK-NEXT: %[[B:.*]] = call @compute2(%[[A]], %[[BBB]]) : (f64, i32) -> i32 + // CHECK-NEXT: %[[A:.*]] = func.call @compute1(%[[BBA]]) : (f64) -> f64 + // CHECK-NEXT: %[[B:.*]] = func.call @compute2(%[[A]], %[[BBB]]) : (f64, i32) -> i32 // CHECK-NEXT: linalg.yield %[[B]] : i32 // CHECK-NEXT: } -> tensor<1x8xi32> %1 = linalg.generic { @@ -674,7 +674,7 @@ ins(%0 : tensor<1x8xf64>) outs(%arg1 : tensor<1x8xi32>) { ^bb0(%a: f64, %b: i32): - %r = call @compute2(%a, %b) : (f64, i32) -> i32 + %r = func.call @compute2(%a, %b) : (f64, i32) -> i32 linalg.yield %r : i32 } -> tensor<1x8xi32> diff --git a/mlir/test/Dialect/OpenMP/invalid.mlir b/mlir/test/Dialect/OpenMP/invalid.mlir --- a/mlir/test/Dialect/OpenMP/invalid.mlir +++ b/mlir/test/Dialect/OpenMP/invalid.mlir @@ -708,7 +708,7 @@ // ----- -func @omp_atomic_update(%x: memref, %expr: i32) { +func.func @omp_atomic_update(%x: memref, %expr: i32) { // expected-error @below {{the hints omp_sync_hint_uncontended and omp_sync_hint_contended cannot be combined}} omp.atomic.update hint(uncontended, contended) %x : memref { ^bb0(%xval: i32): @@ -720,7 +720,7 @@ // ----- -func @omp_atomic_update(%x: memref, %expr: i32) { +func.func @omp_atomic_update(%x: memref, %expr: i32) { // expected-error @below {{the hints omp_sync_hint_nonspeculative and omp_sync_hint_speculative cannot be combined}} omp.atomic.update hint(nonspeculative, speculative) %x : memref { ^bb0(%xval: i32): @@ -732,7 +732,7 @@ // ----- -func @omp_atomic_update(%x: memref, %expr: i32) { +func.func @omp_atomic_update(%x: memref, %expr: i32) { // expected-error @below {{invalid_hint is not a valid hint}} omp.atomic.update hint(invalid_hint) %x : memref { ^bb0(%xval: i32): @@ -884,7 +884,7 @@ // ----- -func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { +func.func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { // expected-error @below {{the hints omp_sync_hint_uncontended and omp_sync_hint_contended cannot be combined}} omp.atomic.capture hint(contended, uncontended) { omp.atomic.update %x : memref { @@ -899,7 +899,7 @@ // ----- -func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { +func.func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { // expected-error @below {{the hints omp_sync_hint_nonspeculative and omp_sync_hint_speculative cannot be combined}} omp.atomic.capture hint(nonspeculative, speculative) { omp.atomic.update %x : memref { @@ -914,7 +914,7 @@ // ----- -func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { +func.func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { // expected-error @below {{invalid_hint is not a valid hint}} omp.atomic.capture hint(invalid_hint) { omp.atomic.update %x : memref { @@ -929,7 +929,7 @@ // ----- -func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { +func.func @omp_atomic_capture(%x: memref, %v: memref, %expr: i32) { // expected-error @below {{operations inside capture region must not have hint clause}} omp.atomic.capture { omp.atomic.update hint(uncontended) %x : memref { diff --git a/mlir/test/Dialect/SCF/canonicalize.mlir b/mlir/test/Dialect/SCF/canonicalize.mlir --- a/mlir/test/Dialect/SCF/canonicalize.mlir +++ b/mlir/test/Dialect/SCF/canonicalize.mlir @@ -137,7 +137,7 @@ func.func private @side_effect() func.func @one_unused(%cond: i1) -> (index) { %0, %1 = scf.if %cond -> (index, index) { - call @side_effect() : () -> () + func.call @side_effect() : () -> () %c0 = "test.value0"() : () -> (index) %c1 = "test.value1"() : () -> (index) scf.yield %c0, %c1 : index, index @@ -166,7 +166,7 @@ func.func @nested_unused(%cond1: i1, %cond2: i1) -> (index) { %0, %1 = scf.if %cond1 -> (index, index) { %2, %3 = scf.if %cond2 -> (index, index) { - call @side_effect() : () -> () + func.call @side_effect() : () -> () %c0 = "test.value0"() : () -> (index) %c1 = "test.value1"() : () -> (index) scf.yield %c0, %c1 : index, index @@ -208,10 +208,10 @@ %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index %0, %1 = scf.if %cond -> (index, index) { - call @side_effect() : () -> () + func.call @side_effect() : () -> () scf.yield %c0, %c1 : index, index } else { - call @side_effect() : () -> () + func.call @side_effect() : () -> () scf.yield %c0, %c1 : index, index } return @@ -370,7 +370,7 @@ %a = call @make_i32() : () -> (i32) %b = call @make_i32() : () -> (i32) %r:3 = scf.for %i = %lb to %ub step %step iter_args(%0 = %a, %1 = %a, %2 = %b) -> (i32, i32, i32) { - %c = call @make_i32() : () -> (i32) + %c = func.call @make_i32() : () -> (i32) scf.yield %0, %c, %2 : i32, i32, i32 } return %r#0, %r#1, %r#2 : i32, i32, i32 @@ -380,7 +380,7 @@ // CHECK-NEXT: %[[a:.*]] = call @make_i32() : () -> i32 // CHECK-NEXT: %[[b:.*]] = call @make_i32() : () -> i32 // CHECK-NEXT: %[[r1:.*]] = scf.for {{.*}} iter_args(%arg4 = %[[a]]) -> (i32) { -// CHECK-NEXT: %[[c:.*]] = call @make_i32() : () -> i32 +// CHECK-NEXT: %[[c:.*]] = func.call @make_i32() : () -> i32 // CHECK-NEXT: scf.yield %[[c]] : i32 // CHECK-NEXT: } // CHECK-NEXT: return %[[a]], %[[r1]], %[[b]] : i32, i32, i32 @@ -765,15 +765,15 @@ %m1 = bufferization.to_memref %arg2 : memref<128x128xf32> // CHECK-NEXT: call @process(%[[M0]]) : (memref<128x128xf32>) -> () - call @process(%m0) : (memref<128x128xf32>) -> () + func.call @process(%m0) : (memref<128x128xf32>) -> () // CHECK-NEXT: call @process(%[[M1]]) : (memref<128x128xf32>) -> () - call @process(%m1) : (memref<128x128xf32>) -> () + func.call @process(%m1) : (memref<128x128xf32>) -> () // This does not hoist (fails the bbArg has at most a single check). - // CHECK-NEXT: %[[T:.*]] = call @process_tensor(%[[BBARG_T2]]) : (tensor<128x128xf32>) -> memref<128x128xf32> + // CHECK-NEXT: %[[T:.*]] = func.call @process_tensor(%[[BBARG_T2]]) : (tensor<128x128xf32>) -> memref<128x128xf32> // CHECK-NEXT: %[[YIELD_T:.*]] = bufferization.to_tensor %[[T:.*]] - %m2 = call @process_tensor(%arg3): (tensor<128x128xf32>) -> memref<128x128xf32> + %m2 = func.call @process_tensor(%arg3): (tensor<128x128xf32>) -> memref<128x128xf32> %3 = bufferization.to_tensor %m2 : memref<128x128xf32> // All this stuff goes away, incrementally @@ -843,12 +843,12 @@ // CHECK-NOT: tensor.cast // CHECK: %[[FOR_RES:.*]] = scf.for {{.*}} iter_args(%[[ITER_T0:.*]] = %[[T0]]) -> (tensor<32x1024xf32>) { // CHECK: %[[CAST:.*]] = tensor.cast %[[ITER_T0]] : tensor<32x1024xf32> to tensor -// CHECK: %[[DONE:.*]] = call @do(%[[CAST]]) : (tensor) -> tensor +// CHECK: %[[DONE:.*]] = func.call @do(%[[CAST]]) : (tensor) -> tensor // CHECK: %[[UNCAST:.*]] = tensor.cast %[[DONE]] : tensor to tensor<32x1024xf32> // CHECK: scf.yield %[[UNCAST]] : tensor<32x1024xf32> %0 = tensor.cast %t0 : tensor<32x1024xf32> to tensor %1 = scf.for %i = %c0 to %c1024 step %c32 iter_args(%iter_t0 = %0) -> (tensor) { - %2 = call @do(%iter_t0) : (tensor) -> tensor + %2 = func.call @do(%iter_t0) : (tensor) -> tensor scf.yield %2 : tensor } // CHECK-NOT: tensor.cast diff --git a/mlir/test/Dialect/SparseTensor/conversion_sparse2dense.mlir b/mlir/test/Dialect/SparseTensor/conversion_sparse2dense.mlir --- a/mlir/test/Dialect/SparseTensor/conversion_sparse2dense.mlir +++ b/mlir/test/Dialect/SparseTensor/conversion_sparse2dense.mlir @@ -37,7 +37,7 @@ // CHECK-DAG: %[[M:.*]] = memref.alloc() : memref<13xi32> // CHECK-DAG: linalg.fill ins(%[[zeroI32]] : i32) outs(%[[M]] : memref<13xi32>) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextI32(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextI32(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<1xindex> @@ -76,7 +76,7 @@ // CHECK-DAG: %[[M:.*]] = memref.alloc(%[[SizeI0]]) : memref // CHECK-DAG: linalg.fill ins(%[[zeroI32]] : i32) outs(%[[M]] : memref) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextI32(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextI32(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<1xindex> @@ -119,7 +119,7 @@ // CHECK-DAG: %[[E0:.*]] = arith.constant 0.000000e+00 : f64 // CHECK-DAG: linalg.fill ins(%[[E0]] : f64) outs(%[[M]] : memref<2x4xf64>) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<2xindex> @@ -163,7 +163,7 @@ // CHECK-DAG: %[[E0:.*]] = arith.constant 0.000000e+00 : f64 // CHECK-DAG: linalg.fill ins(%[[E0]] : f64) outs(%[[M]] : memref) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<2xindex> @@ -207,7 +207,7 @@ // CHECK-DAG: %[[E0:.*]] = arith.constant 0.000000e+00 : f64 // CHECK-DAG: linalg.fill ins(%[[E0]] : f64) outs(%[[M]] : memref<2x?xf64>) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<2xindex> @@ -251,7 +251,7 @@ // CHECK-DAG: %[[E0:.*]] = arith.constant 0.000000e+00 : f64 // CHECK-DAG: linalg.fill ins(%[[E0]] : f64) outs(%[[M]] : memref) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<2xindex> @@ -299,7 +299,7 @@ // CHECK-DAG: %[[E0:.*]] = arith.constant 0.000000e+00 : f64 // CHECK-DAG: linalg.fill ins(%[[E0]] : f64) outs(%[[M]] : memref<2x3x4xf64>) // CHECK: scf.while : () -> () { -// CHECK: %[[Cond:.*]] = call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 +// CHECK: %[[Cond:.*]] = func.call @getNextF64(%[[Iter]], %[[IndD]], %[[ElemBuffer]]) : (!llvm.ptr, memref, memref) -> i1 // CHECK: scf.condition(%[[Cond]]) // CHECK: } do { // CHECK: %[[Iv0:.*]] = memref.load %[[IndS]][%[[I0]]] : memref<3xindex> diff --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir --- a/mlir/test/IR/invalid.mlir +++ b/mlir/test/IR/invalid.mlir @@ -826,7 +826,7 @@ func.func @f(f32) { ^bb0(%a : f32): %18 = arith.cmpi slt, %idx, %idx : index - tensor<42 x index // expected-error {{custom op 'tensor' is unknown}} + tensor<42 x index // expected-error {{custom op 'func.tensor' is unknown}} return } diff --git a/mlir/test/Transforms/scf-if-utils.mlir b/mlir/test/Transforms/scf-if-utils.mlir --- a/mlir/test/Transforms/scf-if-utils.mlir +++ b/mlir/test/Transforms/scf-if-utils.mlir @@ -11,10 +11,10 @@ // CHECK-NEXT: } // CHECK: func @outline_if_else( // CHECK-NEXT: %{{.*}} = scf.if %{{.*}} -> (i8) { -// CHECK-NEXT: %{{.*}} = call @outlined_then0(%{{.*}}, %{{.*}}) : (i1, memref) -> i8 +// CHECK-NEXT: %{{.*}} = func.call @outlined_then0(%{{.*}}, %{{.*}}) : (i1, memref) -> i8 // CHECK-NEXT: scf.yield %{{.*}} : i8 // CHECK-NEXT: } else { -// CHECK-NEXT: %{{.*}} = call @outlined_else0(%{{.*}}) : (i8) -> i8 +// CHECK-NEXT: %{{.*}} = func.call @outlined_else0(%{{.*}}) : (i8) -> i8 // CHECK-NEXT: scf.yield %{{.*}} : i8 // CHECK-NEXT: } // CHECK-NEXT: return @@ -37,7 +37,7 @@ // CHECK-NEXT: } // CHECK: func @outline_if( // CHECK-NEXT: scf.if %{{.*}} { -// CHECK-NEXT: call @outlined_then0(%{{.*}}, %{{.*}}) : (i1, memref) -> () +// CHECK-NEXT: func.call @outlined_then0(%{{.*}}, %{{.*}}) : (i1, memref) -> () // CHECK-NEXT: } // CHECK-NEXT: return // CHECK-NEXT: } @@ -60,9 +60,9 @@ // CHECK-NEXT: } // CHECK: func @outline_empty_if_else( // CHECK-NEXT: scf.if %{{.*}} { -// CHECK-NEXT: call @outlined_then0() : () -> () +// CHECK-NEXT: func.call @outlined_then0() : () -> () // CHECK-NEXT: } else { -// CHECK-NEXT: call @outlined_else0(%{{.*}}, %{{.*}}) : (i1, memref) -> () +// CHECK-NEXT: func.call @outlined_else0(%{{.*}}, %{{.*}}) : (i1, memref) -> () // CHECK-NEXT: } // CHECK-NEXT: return // CHECK-NEXT: } diff --git a/mlir/test/Transforms/test-legalize-erased-op-with-uses.mlir b/mlir/test/Transforms/test-legalize-erased-op-with-uses.mlir --- a/mlir/test/Transforms/test-legalize-erased-op-with-uses.mlir +++ b/mlir/test/Transforms/test-legalize-erased-op-with-uses.mlir @@ -5,6 +5,6 @@ func.func @remove_all_ops(%arg0: i32) -> i32 { // expected-error@below {{failed to legalize operation 'test.illegal_op_a' marked as erased}} %0 = "test.illegal_op_a"() : () -> i32 - // expected-note@below {{found live user of result #0: return %0 : i32}} + // expected-note@below {{found live user of result #0: func.return %0 : i32}} return %0 : i32 } diff --git a/mlir/test/python/ir/operation.py b/mlir/test/python/ir/operation.py --- a/mlir/test/python/ir/operation.py +++ b/mlir/test/python/ir/operation.py @@ -75,7 +75,7 @@ # CHECK: REGION 0: # CHECK: BLOCK 0: # CHECK: OP 0: %0 = "custom.addi" - # CHECK: OP 1: return + # CHECK: OP 1: func.return walk_operations("", op) @@ -114,7 +114,7 @@ # CHECK: BLOCK 0: # CHECK: OP 0: %0 = "custom.addi" # CHECK: OP 0: parent func.func - # CHECK: OP 1: return + # CHECK: OP 1: func.return # CHECK: OP 1: parent func.func walk_operations("", module.operation) @@ -803,7 +803,7 @@ @run def testModuleMerge(): with Context(): - m1 = Module.parse("func private @foo()") + m1 = Module.parse("func.func private @foo()") m2 = Module.parse(""" func.func private @bar() func.func private @qux() @@ -829,8 +829,8 @@ @run def testAppendMoveFromAnotherBlock(): with Context(): - m1 = Module.parse("func private @foo()") - m2 = Module.parse("func private @bar()") + m1 = Module.parse("func.func private @foo()") + m2 = Module.parse("func.func private @bar()") func = m1.body.operations[0] m2.body.append(func) @@ -848,7 +848,7 @@ @run def testDetachFromParent(): with Context(): - m1 = Module.parse("func private @foo()") + m1 = Module.parse("func.func private @foo()") func = m1.body.operations[0].detach_from_parent() try: