File tree 2 files changed +44
-0
lines changed
mlir/lib/Dialect/OpenMP/IR
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,42 @@ subroutine omp_target_private
28
28
! CHECK-NEXT: }
29
29
30
30
end subroutine omp_target_private
31
+
32
+ ! CHECK-LABEL: func.func @_QPomp_target_target_do_simd()
33
+ subroutine omp_target_target_do_simd ()
34
+ implicit none
35
+
36
+ real (8 ) :: var
37
+ integer (8 ) :: iv
38
+
39
+ ! $omp target teams distribute parallel do simd private(iv,var)
40
+ do iv= 0 ,10
41
+ var = 3.14
42
+ end do
43
+ ! $omp end target teams distribute parallel do simd
44
+
45
+ ! CHECK: omp.target trip_count
46
+ ! CHECK: fir.alloca f64 {bindc_name = "var", pinned
47
+ ! CHECK: omp.teams {
48
+ ! CHECK: fir.alloca i64
49
+ ! CHECK: omp.distribute {
50
+ ! CHECK-NEXT: omp.parallel {
51
+ ! CHECK-NEXT: omp.wsloop {
52
+ ! CHECK-NEXT: omp.simd {
53
+ ! CHECK-NEXT: omp.loop_nest
54
+ ! CHECK: omp.yield
55
+ ! CHECK-NEXT: }
56
+ ! CHECK-NEXT: omp.terminator
57
+ ! CHECK-NEXT: }
58
+ ! CHECK-NEXT: omp.terminator
59
+ ! CHECK-NEXT: }
60
+ ! CHECK-NEXT: omp.terminator
61
+ ! CHECK-NEXT: }
62
+ ! CHECK-NEXT: omp.terminator
63
+ ! CHECK-NEXT: }
64
+ ! CHECK-NEXT: omp.terminator
65
+ ! CHECK-NEXT: }
66
+ ! CHECK-NEXT: omp.terminator
67
+ ! CHECK-NEXT: }
68
+
69
+ end subroutine omp_target_target_do_simd
Original file line number Diff line number Diff line change @@ -1389,6 +1389,11 @@ bool TargetOp::isTargetSPMDLoop() {
1389
1389
return false ;
1390
1390
1391
1391
Operation *workshareOp = capturedOp->getParentOp ();
1392
+
1393
+ // Accept optional SIMD leaf construct.
1394
+ if (isa_and_present<SimdOp>(workshareOp))
1395
+ workshareOp = workshareOp->getParentOp ();
1396
+
1392
1397
if (!isa_and_present<WsloopOp>(workshareOp))
1393
1398
return false ;
1394
1399
You can’t perform that action at this time.
0 commit comments