r259465 - [OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 1 20:59:53 PST 2016
Author: abataev
Date: Mon Feb 1 22:59:52 2016
New Revision: 259465
URL: http://llvm.org/viewvc/llvm-project?rev=259465&view=rev
Log:
[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.
Modified:
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/test/OpenMP/nesting_of_regions.cpp
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=259465&r1=259464&r2=259465&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Mon Feb 1 22:59:52 2016
@@ -1925,7 +1925,7 @@ static bool CheckNestingOfRegions(Sema &
// | simd | for simd | |
// | simd | master | |
// | simd | critical | |
- // | simd | simd | |
+ // | simd | simd | * |
// | simd | sections | |
// | simd | section | |
// | simd | single | |
@@ -1959,7 +1959,7 @@ static bool CheckNestingOfRegions(Sema &
// | for simd | for simd | |
// | for simd | master | |
// | for simd | critical | |
- // | for simd | simd | |
+ // | for simd | simd | * |
// | for simd | sections | |
// | for simd | section | |
// | for simd | single | |
@@ -1993,7 +1993,7 @@ static bool CheckNestingOfRegions(Sema &
// | parallel for simd| for simd | |
// | parallel for simd| master | |
// | parallel for simd| critical | |
- // | parallel for simd| simd | |
+ // | parallel for simd| simd | * |
// | parallel for simd| sections | |
// | parallel for simd| section | |
// | parallel for simd| single | |
@@ -2434,7 +2434,7 @@ static bool CheckNestingOfRegions(Sema &
// | taskloop simd | for simd | |
// | taskloop simd | master | |
// | taskloop simd | critical | |
- // | taskloop simd | simd | |
+ // | taskloop simd | simd | * |
// | taskloop simd | sections | |
// | taskloop simd | section | |
// | taskloop simd | single | |
@@ -2509,7 +2509,8 @@ static bool CheckNestingOfRegions(Sema &
ShouldBeInTargetRegion,
ShouldBeInTeamsRegion
} Recommend = NoRecommend;
- if (isOpenMPSimdDirective(ParentRegion) && CurrentRegion != OMPD_ordered) {
+ if (isOpenMPSimdDirective(ParentRegion) && CurrentRegion != OMPD_ordered &&
+ CurrentRegion != OMPD_simd) {
// OpenMP [2.16, Nesting of Regions]
// OpenMP constructs may not be nested inside a simd region.
// OpenMP [2.8.1,simd Construct, Restrictions]
Modified: cfe/trunk/test/OpenMP/nesting_of_regions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nesting_of_regions.cpp?rev=259465&r1=259464&r2=259465&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/nesting_of_regions.cpp (original)
+++ cfe/trunk/test/OpenMP/nesting_of_regions.cpp Mon Feb 1 22:59:52 2016
@@ -137,7 +137,7 @@ void foo() {
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp simd
for (int i = 0; i < 10; ++i)
;
}
@@ -468,7 +468,7 @@ void foo() {
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp simd
for (int i = 0; i < 10; ++i)
;
}
@@ -1730,7 +1730,7 @@ void foo() {
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd// expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp simd
for (int i = 0; i < 10; ++i)
;
}
@@ -3504,7 +3504,7 @@ void foo() {
}
#pragma omp simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp simd
for (int i = 0; i < 10; ++i)
;
}
@@ -3818,7 +3818,7 @@ void foo() {
}
#pragma omp for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd // expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp simd
for (int i = 0; i < 10; ++i)
;
}
@@ -5053,7 +5053,7 @@ void foo() {
}
#pragma omp parallel for simd
for (int i = 0; i < 10; ++i) {
-#pragma omp simd// expected-error {{OpenMP constructs may not be nested inside a simd region}}
+#pragma omp simd
for (int i = 0; i < 10; ++i)
;
}
More information about the cfe-commits
mailing list