@@ -479,20 +479,16 @@ func.func @shuffle_unsupported_type_vec(%arg0 : vector<[4]xf32>, %arg1 : i32, %a
479479// -----
480480
481481func.func @rotate_mismatching_type (%arg0 : f32 ) {
482- %offset = arith.constant 4 : i32
483- %width = arith.constant 16 : i32
484482 // expected-error@+1 {{op failed to verify that all of {value, rotateResult} have same type}}
485- %rotate , %valid = " gpu.rotate" (%arg0 , % offset, %width ) : ( f32 , i32 , i32 ) -> (i32 , i1 )
483+ %rotate , %valid = " gpu.rotate" (%arg0 ) { offset = 4 : i32 , width = 16 : i32 } : ( f32 ) -> (i32 , i1 )
486484 return
487485}
488486
489487// -----
490488
491489func.func @rotate_unsupported_type (%arg0 : index ) {
492- %offset = arith.constant 4 : i32
493- %width = arith.constant 16 : i32
494490 // expected-error@+1 {{op operand #0 must be Integer or Float or fixed-length vector of Integer or Float values of ranks 1, but got 'index'}}
495- %rotate , %valid = gpu.rotate %arg0 , %offset , %width : index
491+ %rotate , %valid = gpu.rotate %arg0 , 4 , 16 : index
496492 return
497493}
498494
@@ -502,55 +498,31 @@ func.func @rotate_unsupported_type_vec(%arg0 : vector<[4]xf32>) {
502498 %offset = arith.constant 4 : i32
503499 %width = arith.constant 16 : i32
504500 // expected-error@+1 {{op operand #0 must be Integer or Float or fixed-length vector of Integer or Float values of ranks 1, but got 'vector<[4]xf32>'}}
505- %rotate , %valid = gpu.rotate %arg0 , %offset , %width : vector <[4 ]xf32 >
501+ %rotate , %valid = gpu.rotate %arg0 , 4 , 16 : vector <[4 ]xf32 >
506502 return
507503}
508504
509505// -----
510506
511507func.func @rotate_unsupported_width (%arg0 : f32 ) {
512- %offset = arith.constant 4 : i32
513- %width = arith.constant 15 : i32
514- // expected-error@+1 {{op width must be a power of two}}
515- %rotate , %valid = " gpu.rotate" (%arg0 , %offset , %width ) : (f32 , i32 , i32 ) -> (f32 , i1 )
508+ // expected-error@+1 {{'gpu.rotate' op attribute 'width' failed to satisfy constraint: 32-bit signless integer attribute whose value is a power of two > 0}}
509+ %rotate , %valid = " gpu.rotate" (%arg0 ) { offset = 4 : i32 , width = 15 : i32 } : (f32 ) -> (f32 , i1 )
516510 return
517511}
518512
519513// -----
520514
521515func.func @rotate_unsupported_offset (%arg0 : f32 ) {
522- %offset = arith.constant 16 : i32
523- %width = arith.constant 16 : i32
524516 // expected-error@+1 {{op offset must be in the range [0, 16)}}
525- %rotate , %valid = " gpu.rotate" (%arg0 , % offset, %width ) : ( f32 , i32 , i32 ) -> (f32 , i1 )
517+ %rotate , %valid = " gpu.rotate" (%arg0 ) { offset = 16 : i32 , width = 16 : i32 }: ( f32 ) -> (f32 , i1 )
526518 return
527519}
528520
529521// -----
530522
531523func.func @rotate_unsupported_offset_minus (%arg0 : f32 ) {
532- %offset = arith.constant -1 : i32
533- %width = arith.constant 16 : i32
534- // expected-error@+1 {{op offset must be in the range [0, 16)}}
535- %rotate , %valid = " gpu.rotate" (%arg0 , %offset , %width ) : (f32 , i32 , i32 ) -> (f32 , i1 )
536- return
537- }
538-
539- // -----
540-
541- func.func @rotate_offset_non_constant (%arg0 : f32 , %offset : i32 ) {
542- %width = arith.constant 16 : i32
543- // expected-error@+1 {{op offset is not a constant value}}
544- %rotate , %valid = " gpu.rotate" (%arg0 , %offset , %width ) : (f32 , i32 , i32 ) -> (f32 , i1 )
545- return
546- }
547-
548- // -----
549-
550- func.func @rotate_width_non_constant (%arg0 : f32 , %width : i32 ) {
551- %offset = arith.constant 0 : i32
552- // expected-error@+1 {{op width is not a constant value}}
553- %rotate , %valid = " gpu.rotate" (%arg0 , %offset , %width ) : (f32 , i32 , i32 ) -> (f32 , i1 )
524+ // expected-error@+1 {{'gpu.rotate' op attribute 'offset' failed to satisfy constraint: 32-bit signless integer attribute whose minimum value is 0}}
525+ %rotate , %valid = " gpu.rotate" (%arg0 ) { offset = -1 : i32 , width = 16 : i32 } : (f32 ) -> (f32 , i1 )
554526 return
555527}
556528
0 commit comments