@@ -609,17 +609,17 @@ func.func @redundantTest(%arg0: i32) -> i32 {
609
609
// Test either directive
610
610
//===----------------------------------------------------------------------===//
611
611
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 ) -> () {
614
614
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
615
615
%0 = " test.either_op_a" (%arg0 , %arg1 , %arg2 ) : (i32 , i16 , i8 ) -> i32
616
616
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
617
617
%1 = " test.either_op_a" (%arg1 , %arg0 , %arg2 ) : (i16 , i32 , i8 ) -> i32
618
618
return
619
619
}
620
620
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 ) -> () {
623
623
%0 = " test.either_op_b" (%arg0 , %arg0 ) : (i32 , i32 ) -> i32
624
624
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
625
625
%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) -> ()
628
628
return
629
629
}
630
630
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 ) -> () {
633
633
%0 = " test.either_op_b" (%arg0 , %arg0 ) : (i32 , i32 ) -> i32
634
634
%1 = " test.either_op_b" (%arg1 , %arg1 ) : (i16 , i16 ) -> i32
635
635
// CHECK: "test.either_op_b"(%arg1, %arg2) : (i16, i8) -> i32
@@ -639,24 +639,38 @@ func.func @either_dag_node_dag_node(%arg0 : i32, %arg1 : i16, %arg2 : i8) -> ()
639
639
return
640
640
}
641
641
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
+
642
653
//===----------------------------------------------------------------------===//
643
654
// Test that ops without type deduction can be created with type builders.
644
655
//===----------------------------------------------------------------------===//
645
656
657
+ // CHECK-LABEL: @explicitReturnTypeTest
646
658
func.func @explicitReturnTypeTest (%arg0 : i64 ) -> i8 {
647
659
%0 = " test.source_op" (%arg0 ) {tag = 11 : i32 } : (i64 ) -> i8
648
660
// CHECK: "test.op_x"(%arg0) : (i64) -> i32
649
661
// CHECK: "test.op_x"(%0) : (i32) -> i8
650
662
return %0 : i8
651
663
}
652
664
665
+ // CHECK-LABEL: @returnTypeBuilderTest
653
666
func.func @returnTypeBuilderTest (%arg0 : i1 ) -> i8 {
654
667
%0 = " test.source_op" (%arg0 ) {tag = 22 : i32 } : (i1 ) -> i8
655
668
// CHECK: "test.op_x"(%arg0) : (i1) -> i1
656
669
// CHECK: "test.op_x"(%0) : (i1) -> i8
657
670
return %0 : i8
658
671
}
659
672
673
+ // CHECK-LABEL: @multipleReturnTypeBuildTest
660
674
func.func @multipleReturnTypeBuildTest (%arg0 : i1 ) -> i1 {
661
675
%0 = " test.source_op" (%arg0 ) {tag = 33 : i32 } : (i1 ) -> i1
662
676
// CHECK: "test.one_to_two"(%arg0) : (i1) -> (i64, i32)
@@ -666,13 +680,15 @@ func.func @multipleReturnTypeBuildTest(%arg0 : i1) -> i1 {
666
680
return %0 : i1
667
681
}
668
682
683
+ // CHECK-LABEL: @copyValueType
669
684
func.func @copyValueType (%arg0 : i8 ) -> i32 {
670
685
%0 = " test.source_op" (%arg0 ) {tag = 44 : i32 } : (i8 ) -> i32
671
686
// CHECK: "test.op_x"(%arg0) : (i8) -> i8
672
687
// CHECK: "test.op_x"(%0) : (i8) -> i32
673
688
return %0 : i32
674
689
}
675
690
691
+ // CHECK-LABEL: @multipleReturnTypeDifferent
676
692
func.func @multipleReturnTypeDifferent (%arg0 : i1 ) -> i64 {
677
693
%0 = " test.source_op" (%arg0 ) {tag = 55 : i32 } : (i1 ) -> i64
678
694
// CHECK: "test.one_to_two"(%arg0) : (i1) -> (i1, i64)
@@ -684,6 +700,7 @@ func.func @multipleReturnTypeDifferent(%arg0 : i1) -> i64 {
684
700
// Test that multiple trailing directives can be mixed in patterns.
685
701
//===----------------------------------------------------------------------===//
686
702
703
+ // CHECK-LABEL: @returnTypeAndLocation
687
704
func.func @returnTypeAndLocation (%arg0 : i32 ) -> i1 {
688
705
%0 = " test.source_op" (%arg0 ) {tag = 66 : i32 } : (i32 ) -> i1
689
706
// CHECK: "test.op_x"(%arg0) : (i32) -> i32 loc("loc1")
@@ -696,6 +713,7 @@ func.func @returnTypeAndLocation(%arg0 : i32) -> i1 {
696
713
// Test that patterns can create ConstantStrAttr
697
714
//===----------------------------------------------------------------------===//
698
715
716
+ // CHECK-LABEL: @testConstantStrAttr
699
717
func.func @testConstantStrAttr () -> () {
700
718
// CHECK: test.has_str_value {value = "foo"}
701
719
test.no_str_value {value = " bar" }
@@ -706,6 +724,7 @@ func.func @testConstantStrAttr() -> () {
706
724
// Test that patterns with variadics propagate sizes
707
725
//===----------------------------------------------------------------------===//
708
726
727
+ // CHECK-LABEL: @testVariadic
709
728
func.func @testVariadic (%arg_0: i32 , %arg_1: i32 , %brg: i64 ,
710
729
%crg_0: f32 , %crg_1: f32 , %crg_2: f32 , %crg_3: f32 ) -> () {
711
730
// CHECK: "test.variadic_rewrite_dst_op"(%arg2, %arg3, %arg4, %arg5, %arg6, %arg0, %arg1) <{operandSegmentSizes = array<i32: 1, 4, 2>}> : (i64, f32, f32, f32, f32, i32, i32) -> ()
0 commit comments