@@ -2391,7 +2391,7 @@ func.func @omp_distribute_allocate(%data_var : memref<i32>, %lb : i32, %ub : i32
2391
2391
// -----
2392
2392
2393
2393
func.func @omp_distribute_nested_wrapper (%lb: index , %ub: index , %step: index ) -> () {
2394
- // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when 'omp.parallel' is the direct parent}}
2394
+ // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when a composite 'omp.parallel' is the direct parent}}
2395
2395
omp.distribute {
2396
2396
" omp.wsloop" () ({
2397
2397
omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
@@ -2429,6 +2429,22 @@ func.func @omp_distribute_nested_wrapper3(%lb: index, %ub: index, %step: index)
2429
2429
2430
2430
// -----
2431
2431
2432
+ func.func @omp_distribute_nested_wrapper4 (%lb: index , %ub: index , %step: index ) -> () {
2433
+ omp.parallel {
2434
+ // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when a composite 'omp.parallel' is the direct parent}}
2435
+ omp.distribute {
2436
+ " omp.wsloop" () ({
2437
+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2438
+ " omp.yield" () : () -> ()
2439
+ }
2440
+ }) {omp.composite } : () -> ()
2441
+ } {omp.composite }
2442
+ omp.terminator
2443
+ }
2444
+ }
2445
+
2446
+ // -----
2447
+
2432
2448
func.func @omp_distribute_order () -> () {
2433
2449
// expected-error @below {{invalid clause value: 'default'}}
2434
2450
omp.distribute order (default ) {
@@ -2623,15 +2639,13 @@ func.func @masked_arg_count_mismatch(%arg0: i32, %arg1: i32) {
2623
2639
2624
2640
// -----
2625
2641
func.func @omp_parallel_missing_composite (%lb: index , %ub: index , %step: index ) -> () {
2626
- // expected-error@+1 {{'omp.composite' attribute missing from composite operation}}
2642
+ // expected-error @below {{'omp.composite' attribute missing from composite operation}}
2627
2643
omp.parallel {
2628
2644
omp.distribute {
2629
- omp.wsloop {
2630
- omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2631
- omp.yield
2632
- }
2633
- } {omp.composite }
2634
- } {omp.composite }
2645
+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2646
+ omp.yield
2647
+ }
2648
+ }
2635
2649
omp.terminator
2636
2650
}
2637
2651
return
@@ -2653,7 +2667,7 @@ func.func @omp_parallel_invalid_composite(%lb: index, %ub: index, %step: index)
2653
2667
2654
2668
// -----
2655
2669
func.func @omp_parallel_invalid_composite2 (%lb: index , %ub: index , %step: index ) -> () {
2656
- // expected-error @below {{unexpected OpenMP operation inside of composite 'omp.parallel'}}
2670
+ // expected-error @below {{unexpected OpenMP operation inside of composite 'omp.parallel': omp.barrier }}
2657
2671
omp.parallel {
2658
2672
omp.barrier
2659
2673
omp.distribute {
@@ -2668,6 +2682,29 @@ func.func @omp_parallel_invalid_composite2(%lb: index, %ub: index, %step: index)
2668
2682
return
2669
2683
}
2670
2684
2685
+ // -----
2686
+ func.func @omp_parallel_invalid_composite3 (%lb: index , %ub: index , %step: index ) -> () {
2687
+ // expected-error @below {{multiple 'omp.distribute' nested inside of 'omp.parallel'}}
2688
+ omp.parallel {
2689
+ omp.distribute {
2690
+ omp.wsloop {
2691
+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2692
+ omp.yield
2693
+ }
2694
+ } {omp.composite }
2695
+ } {omp.composite }
2696
+ omp.distribute {
2697
+ omp.wsloop {
2698
+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2699
+ omp.yield
2700
+ }
2701
+ } {omp.composite }
2702
+ } {omp.composite }
2703
+ omp.terminator
2704
+ } {omp.composite }
2705
+ return
2706
+ }
2707
+
2671
2708
// -----
2672
2709
func.func @omp_wsloop_missing_composite (%lb: index , %ub: index , %step: index ) -> () {
2673
2710
// expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
@@ -2787,7 +2824,7 @@ func.func @omp_taskloop_invalid_composite(%lb: index, %ub: index, %step: index)
2787
2824
2788
2825
func.func @omp_loop_invalid_nesting (%lb : index , %ub : index , %step : index ) {
2789
2826
2790
- // expected-error @below {{` omp.loop` expected to be a standalone loop wrapper}}
2827
+ // expected-error @below {{' omp.loop' op expected to be a standalone loop wrapper}}
2791
2828
omp.loop {
2792
2829
omp.simd {
2793
2830
omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
@@ -2804,7 +2841,7 @@ func.func @omp_loop_invalid_nesting(%lb : index, %ub : index, %step : index) {
2804
2841
func.func @omp_loop_invalid_nesting2 (%lb : index , %ub : index , %step : index ) {
2805
2842
2806
2843
omp.simd {
2807
- // expected-error @below {{` omp.loop` expected to be a standalone loop wrapper}}
2844
+ // expected-error @below {{' omp.loop' op expected to be a standalone loop wrapper}}
2808
2845
omp.loop {
2809
2846
omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2810
2847
omp.yield
@@ -2831,7 +2868,7 @@ func.func @omp_loop_invalid_binding(%lb : index, %ub : index, %step : index) {
2831
2868
// -----
2832
2869
func.func @nested_wrapper (%idx : index ) {
2833
2870
omp.workshare {
2834
- // expected-error @below {{cannot be composite }}
2871
+ // expected-error @below {{'omp.workshare.loop_wrapper' op expected to be a standalone loop wrapper }}
2835
2872
omp.workshare.loop_wrapper {
2836
2873
omp.simd {
2837
2874
omp.loop_nest (%iv ) : index = (%idx ) to (%idx ) step (%idx ) {
0 commit comments