diff --git a/test/Transforms/Substrait/emit-deduplication.mlir b/test/Transforms/Substrait/emit-deduplication.mlir index 68233beb1ae3..0a7d53213e8f 100644 --- a/test/Transforms/Substrait/emit-deduplication.mlir +++ b/test/Transforms/Substrait/emit-deduplication.mlir @@ -1,4 +1,5 @@ -// RUN: structured-opt -split-input-file %s -substrait-emit-deduplication \ +// RUN: structured-opt -split-input-file %s \ +// RUN: -substrait-emit-deduplication -allow-unregistered-dialect \ // RUN: | FileCheck %s // `cross` op with left `emit` input with duplicates. @@ -165,13 +166,11 @@ substrait.plan version 0 : 42 : 1 { // CHECK-NEXT: %[[V6:.*]] = field_reference %[[ARG0]][1] : [[TYPE]] // CHECK-NEXT: %[[V7:.*]] = field_reference %[[V6]][1] : // CHECK-NEXT: %[[V9:.*]] = field_reference %[[ARG0]][2] : [[TYPE]] -// CHECK-NEXT: %[[Va:.*]] = func.call @f(%[[V3]], %[[V3]], %[[V5]], %[[V7]], %[[V3]], %[[V9]]) +// CHECK-NEXT: %[[Va:.*]] = "test.op"(%[[V3]], %[[V3]], %[[V5]], %[[V7]], %[[V3]], %[[V9]]) // CHECK-NEXT: yield %[[Va]] : si1 // CHECK-NEXT: } // CHECK-NEXT: %[[Vb:.*]] = emit [0, 0, 1, 0, 2] from %[[V2]] -func.func private @f(si1, si1, si1, si32, si1, si1) -> si1 - substrait.plan version 0 : 42 : 1 { relation { %0 = named_table @t1 as ["a", "b", "c", "d", "e"] : tuple> @@ -189,7 +188,7 @@ substrait.plan version 0 : 42 : 1 { %7 = field_reference %6[1] : tuple %8 = field_reference %arg0[3] : tuple, si1, si1> %9 = field_reference %arg0[4] : tuple, si1, si1> - %a = func.call @f(%3, %4, %5, %7, %8, %9) : (si1, si1, si1, si32, si1, si1) -> si1 + %a = "test.op"(%3, %4, %5, %7, %8, %9) : (si1, si1, si1, si32, si1, si1) -> si1 yield %a : si1 } yield %2 : tuple, si1, si1> @@ -207,13 +206,11 @@ substrait.plan version 0 : 42 : 1 { // CHECK-NEXT: %[[V2:.*]] = project %[[V1]] : tuple -> tuple { // CHECK-NEXT: ^{{.*}}(%[[ARG0:.*]]: [[TYPE:.*]]): // CHECK-NEXT: %[[V3:.*]] = field_reference %[[ARG0]][0] : [[TYPE]] -// CHECK-NEXT: %[[V5:.*]] = func.call @f(%[[V3]], %[[V3]]) : +// CHECK-NEXT: %[[V5:.*]] = "test.op"(%[[V3]], %[[V3]]) : // CHECK-NEXT: yield %[[V5]] : si1 // CHECK-NEXT: } // CHECK-NEXT: %[[V6:.*]] = emit [0, 0, 1] from %[[V2]] -func.func private @f(si32, si32) -> si1 - substrait.plan version 0 : 42 : 1 { relation { %0 = named_table @t1 as ["a", "b"] : tuple @@ -222,7 +219,7 @@ substrait.plan version 0 : 42 : 1 { ^bb0(%arg : tuple): %3 = field_reference %arg[0] : tuple %4 = field_reference %arg[1] : tuple - %5 = func.call @f(%3, %4) : (si32, si32) -> si1 + %5 = "test.op"(%3, %4) : (si32, si32) -> si1 yield %5 : si1 } yield %2 : tuple @@ -239,20 +236,18 @@ substrait.plan version 0 : 42 : 1 { // CHECK-NEXT: %[[V1:.*]] = project %[[V0]] : {{.*}} { // CHECK-NEXT: ^{{.*}}(%[[ARG0:.*]]: [[TYPE:.*]]): // CHECK-NEXT: %[[V2:.*]] = field_reference %[[ARG0]][0] : [[TYPE]] -// CHECK-NEXT: %[[V3:.*]] = func.call @f(%[[V2]]) : +// CHECK-NEXT: %[[V3:.*]] = "test.op"(%[[V2]]) : // CHECK-NEXT: yield %[[V3]] : si1 // CHECK-NEXT: } // CHECK-NEXT: %[[V4:.*]] = emit [0, 1, 1] from %[[V1]] -func.func private @f(si32) -> si1 - substrait.plan version 0 : 42 : 1 { relation { %0 = named_table @t1 as ["a"] : tuple %1 = project %0 : tuple -> tuple { ^bb0(%arg : tuple): %2 = field_reference %arg[0] : tuple - %3 = func.call @f(%2) : (si32) -> si1 + %3 = "test.op"(%2) : (si32) -> si1 // We yield two times the same value. This pattern should remove one of // the two and re-establish the duplicate with an `amit` after the // `project`. @@ -272,20 +267,18 @@ substrait.plan version 0 : 42 : 1 { // CHECK-NEXT: %[[V1:.*]] = project %[[V0]] : {{.*}} { // CHECK-NEXT: ^{{.*}}(%[[ARG0:.*]]: [[TYPE:.*]]): // CHECK-NEXT: %[[V2:.*]] = field_reference %[[ARG0]][0] : [[TYPE]] -// CHECK-NEXT: %[[V3:.*]] = func.call @f(%[[V2]]) : +// CHECK-NEXT: %[[V3:.*]] = "test.op"(%[[V2]]) : // CHECK-NEXT: yield %[[V3]] : si1 // CHECK-NEXT: } // CHECK-NEXT: %[[V4:.*]] = emit [0, 1, 0, 2] from %[[V1]] -func.func private @f(si32) -> si1 - substrait.plan version 0 : 42 : 1 { relation { %0 = named_table @t1 as ["a", "b"] : tuple %1 = project %0 : tuple -> tuple { ^bb0(%arg0: tuple): %2 = field_reference %arg0[0] : tuple - %3 = func.call @f(%2) : (si32) -> si1 + %3 = "test.op"(%2) : (si32) -> si1 // `%2` yields an input field without modifications. This pattern removes // that yielding and re-establishes the duplicated field with an `emit` // following the `project` instead.