Skip to content

Commit 7dc9751

Browse files
committed
amend! [MLIR][DRR] Fix inconsistent operand and arg index usage
[MLIR][DRR] Fix inconsistent operand and arg index usage
1 parent 09316e0 commit 7dc9751

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

mlir/test/mlir-tblgen/pattern.mlir

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,17 +609,17 @@ func.func @redundantTest(%arg0: i32) -> i32 {
609609
// Test either directive
610610
//===----------------------------------------------------------------------===//
611611

612-
// CHECK: @either_dag_leaf_only
613-
func.func @either_dag_leaf_only_1(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> () {
612+
// CHECK-LABEL: @eitherDagLeafOnly
613+
func.func @eitherDagLeafOnly(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> () {
614614
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
615615
%0 = "test.either_op_a"(%arg0, %arg1, %arg2) : (i32, i16, i8) -> i32
616616
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
617617
%1 = "test.either_op_a"(%arg1, %arg0, %arg2) : (i16, i32, i8) -> i32
618618
return
619619
}
620620

621-
// CHECK: @either_dag_leaf_dag_node
622-
func.func @either_dag_leaf_dag_node(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> () {
621+
// CHECK-LABEL: @eitherDagLeafDagNode
622+
func.func @eitherDagLeafDagNode(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> () {
623623
%0 = "test.either_op_b"(%arg0, %arg0) : (i32, i32) -> i32
624624
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
625625
%1 = "test.either_op_a"(%0, %arg1, %arg2) : (i32, i16, i8) -> i32
@@ -628,8 +628,8 @@ func.func @either_dag_leaf_dag_node(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> ()
628628
return
629629
}
630630

631-
// CHECK: @either_dag_node_dag_node
632-
func.func @either_dag_node_dag_node(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> () {
631+
// CHECK-LABEL: @eitherDagNodeDagNode
632+
func.func @eitherDagNodeDagNode(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> () {
633633
%0 = "test.either_op_b"(%arg0, %arg0) : (i32, i32) -> i32
634634
%1 = "test.either_op_b"(%arg1, %arg1) : (i16, i16) -> i32
635635
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
@@ -639,6 +639,17 @@ func.func @either_dag_node_dag_node(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> ()
639639
return
640640
}
641641

642+
// CHECK-LABEL: testEitherOpWithAttr
643+
func.func @testEitherOpWithAttr(%arg0 : i32, %arg1 : i16) -> () {
644+
// CHECK: "test.either_op_b"(%arg1, %arg0) : (i16, i32) -> i32
645+
%0 = "test.either_op_c"(%arg0, %arg1) {attr = 0 : i32} : (i32, i16) -> i32
646+
// CHECK: "test.either_op_b"(%arg1, %arg0) : (i16, i32) -> i32
647+
%1 = "test.either_op_c"(%arg1, %arg0) {attr = 0 : i32} : (i16, i32) -> i32
648+
// CHECK: "test.either_op_c"(%arg0, %arg1) <{attr = 1 : i32}> : (i32, i16) -> i32
649+
%2 = "test.either_op_c"(%arg0, %arg1) {attr = 1 : i32} : (i32, i16) -> i32
650+
return
651+
}
652+
642653
//===----------------------------------------------------------------------===//
643654
// Test that ops without type deduction can be created with type builders.
644655
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)