forked from OSchip/llvm-project
				
			[OPENMP50]Add support for nested atomic and simd constructs in
simd-based directives. According to OpenMP 5.0 standard, ordered simd, atomic and simd directives are allowed as nested directives in the simd-based directives.
This commit is contained in:
		
							parent
							
								
									0e0dea8268
								
							
						
					
					
						commit
						f8c12edd1a
					
				| 
						 | 
				
			
			@ -9312,7 +9312,7 @@ def err_omp_prohibited_region : Error<
 | 
			
		|||
  "; perhaps you forget to enclose 'omp %3' directive into a target region?|"
 | 
			
		||||
  "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">;
 | 
			
		||||
def err_omp_prohibited_region_simd : Error<
 | 
			
		||||
  "OpenMP constructs may not be nested inside a simd region">;
 | 
			
		||||
  "OpenMP constructs may not be nested inside a simd region%select{| except for ordered simd, simd or atomic directive}0">;
 | 
			
		||||
def err_omp_prohibited_region_atomic : Error<
 | 
			
		||||
  "OpenMP constructs may not be nested inside an atomic region">;
 | 
			
		||||
def err_omp_prohibited_region_critical_same_name : Error<
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3799,7 +3799,10 @@ static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack,
 | 
			
		|||
      ShouldBeInTargetRegion,
 | 
			
		||||
      ShouldBeInTeamsRegion
 | 
			
		||||
    } Recommend = NoRecommend;
 | 
			
		||||
    if (isOpenMPSimdDirective(ParentRegion) && CurrentRegion != OMPD_ordered) {
 | 
			
		||||
    if (isOpenMPSimdDirective(ParentRegion) &&
 | 
			
		||||
        ((SemaRef.LangOpts.OpenMP <= 45 && CurrentRegion != OMPD_ordered) ||
 | 
			
		||||
         (SemaRef.LangOpts.OpenMP >= 50 && CurrentRegion != OMPD_ordered &&
 | 
			
		||||
          CurrentRegion != OMPD_simd && CurrentRegion != OMPD_atomic))) {
 | 
			
		||||
      // OpenMP [2.16, Nesting of Regions]
 | 
			
		||||
      // OpenMP constructs may not be nested inside a simd region.
 | 
			
		||||
      // OpenMP [2.8.1,simd Construct, Restrictions]
 | 
			
		||||
| 
						 | 
				
			
			@ -3808,9 +3811,14 @@ static bool checkNestingOfRegions(Sema &SemaRef, const DSAStackTy *Stack,
 | 
			
		|||
      // Allowing a SIMD construct nested in another SIMD construct is an
 | 
			
		||||
      // extension. The OpenMP 4.5 spec does not allow it. Issue a warning
 | 
			
		||||
      // message.
 | 
			
		||||
      // OpenMP 5.0 [2.9.3.1, simd Construct, Restrictions]
 | 
			
		||||
      // The only OpenMP constructs that can be encountered during execution of
 | 
			
		||||
      // a simd region are the atomic construct, the loop construct, the simd
 | 
			
		||||
      // construct and the ordered construct with the simd clause.
 | 
			
		||||
      SemaRef.Diag(StartLoc, (CurrentRegion != OMPD_simd)
 | 
			
		||||
                                 ? diag::err_omp_prohibited_region_simd
 | 
			
		||||
                                 : diag::warn_omp_nesting_simd);
 | 
			
		||||
                                 : diag::warn_omp_nesting_simd)
 | 
			
		||||
          << (SemaRef.LangOpts.OpenMP >= 50 ? 1 : 0);
 | 
			
		||||
      return CurrentRegion != OMPD_simd;
 | 
			
		||||
    }
 | 
			
		||||
    if (ParentRegion == OMPD_atomic) {
 | 
			
		||||
| 
						 | 
				
			
			@ -8165,7 +8173,8 @@ StmtResult Sema::ActOnOpenMPOrderedDirective(ArrayRef<OMPClause *> Clauses,
 | 
			
		|||
    // OpenMP [2.8.1,simd Construct, Restrictions]
 | 
			
		||||
    // An ordered construct with the simd clause is the only OpenMP construct
 | 
			
		||||
    // that can appear in the simd region.
 | 
			
		||||
    Diag(StartLoc, diag::err_omp_prohibited_region_simd);
 | 
			
		||||
    Diag(StartLoc, diag::err_omp_prohibited_region_simd)
 | 
			
		||||
        << (LangOpts.OpenMP >= 50 ? 1 : 0);
 | 
			
		||||
    ErrorFound = true;
 | 
			
		||||
  } else if (DependFound && (TC || SC)) {
 | 
			
		||||
    Diag(DependFound->getBeginLoc(), diag::err_omp_depend_clause_thread_simd)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,8 @@
 | 
			
		|||
// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
 | 
			
		||||
// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify=expected,omp45 %s
 | 
			
		||||
// RUN: %clang_cc1 -fsyntax-only -fopenmp -fopenmp-version=50 -verify=expected,omp50 %s
 | 
			
		||||
 | 
			
		||||
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
 | 
			
		||||
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify=expected,omp45 %s
 | 
			
		||||
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -fopenmp-version=50 -verify=expected,omp50 %s
 | 
			
		||||
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
 | 
			
		||||
 | 
			
		||||
void bar();
 | 
			
		||||
| 
						 | 
				
			
			@ -227,7 +229,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -341,7 +343,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp simd
 | 
			
		||||
| 
						 | 
				
			
			@ -742,7 +744,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -856,7 +858,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp for simd
 | 
			
		||||
| 
						 | 
				
			
			@ -2647,7 +2649,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -2779,7 +2781,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp parallel for simd
 | 
			
		||||
| 
						 | 
				
			
			@ -4685,7 +4687,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DIRECTIVE
 | 
			
		||||
#pragma omp teams // expected-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams // omp45-error {{orphaned 'omp teams' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  bar();
 | 
			
		||||
#pragma omp target
 | 
			
		||||
#pragma omp teams
 | 
			
		||||
| 
						 | 
				
			
			@ -5307,7 +5309,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -5619,7 +5621,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -5858,7 +5860,7 @@ void foo() {
 | 
			
		|||
#pragma omp teams
 | 
			
		||||
#pragma omp distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -5931,7 +5933,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -6008,7 +6010,7 @@ void foo() {
 | 
			
		|||
#pragma omp teams
 | 
			
		||||
#pragma omp distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -6170,7 +6172,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -6227,7 +6229,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -6284,7 +6286,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target simd
 | 
			
		||||
| 
						 | 
				
			
			@ -6373,7 +6375,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute // omp45-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -6465,7 +6467,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -6636,7 +6638,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute // omp45-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -6728,7 +6730,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -6919,7 +6921,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE SIMD DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute simd // omp45-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -6946,7 +6948,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -7011,7 +7013,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -7078,7 +7080,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -7202,7 +7204,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute parallel for simd // expected-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute parallel for simd // omp45-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -7229,7 +7231,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -7294,7 +7296,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -7361,7 +7363,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -7485,7 +7487,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute parallel for // expected-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute parallel for // omp45-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -7577,7 +7579,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8069,7 +8071,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8312,7 +8314,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8498,7 +8500,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8555,7 +8557,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8612,7 +8614,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target teams distribute parallel for simd
 | 
			
		||||
| 
						 | 
				
			
			@ -8741,7 +8743,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8798,7 +8800,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -8855,7 +8857,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target teams distribute simd
 | 
			
		||||
| 
						 | 
				
			
			@ -9182,7 +9184,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -9279,7 +9281,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp simd
 | 
			
		||||
| 
						 | 
				
			
			@ -9672,7 +9674,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -9769,7 +9771,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp for simd
 | 
			
		||||
| 
						 | 
				
			
			@ -11541,7 +11543,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -11673,7 +11675,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp parallel for simd
 | 
			
		||||
| 
						 | 
				
			
			@ -13918,7 +13920,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -14240,7 +14242,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -14487,7 +14489,7 @@ void foo() {
 | 
			
		|||
#pragma omp teams
 | 
			
		||||
#pragma omp distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -14560,7 +14562,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -14637,7 +14639,7 @@ void foo() {
 | 
			
		|||
#pragma omp teams
 | 
			
		||||
#pragma omp distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -14799,7 +14801,7 @@ void foo() {
 | 
			
		|||
#pragma omp teams
 | 
			
		||||
#pragma omp distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -14872,7 +14874,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -14949,7 +14951,7 @@ void foo() {
 | 
			
		|||
#pragma omp teams
 | 
			
		||||
#pragma omp distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -15103,7 +15105,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -15160,7 +15162,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -15217,7 +15219,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target simd
 | 
			
		||||
| 
						 | 
				
			
			@ -15317,7 +15319,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute // expected-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute // omp45-error {{orphaned 'omp teams distribute' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -15409,7 +15411,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -15600,7 +15602,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE SIMD DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute simd // expected-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute simd // omp45-error {{orphaned 'omp teams distribute simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -15627,7 +15629,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -15692,7 +15694,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -15759,7 +15761,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -15883,7 +15885,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE PARALLEL FOR SIMD DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute parallel for simd // expected-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute parallel for simd // omp45-error {{orphaned 'omp teams distribute parallel for simd' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -15910,7 +15912,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -15975,7 +15977,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -16042,7 +16044,7 @@ void foo() {
 | 
			
		|||
#pragma omp target
 | 
			
		||||
#pragma omp teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -16166,7 +16168,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
// TEAMS DISTRIBUTE PARALLEL FOR DIRECTIVE
 | 
			
		||||
#pragma omp teams distribute parallel for // expected-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
#pragma omp teams distribute parallel for // omp45-error {{orphaned 'omp teams distribute parallel for' directives are prohibited; perhaps you forget to enclose the directive into a target region?}}
 | 
			
		||||
  for (int i = 0; i < 10; ++i)
 | 
			
		||||
    ;
 | 
			
		||||
#pragma omp target
 | 
			
		||||
| 
						 | 
				
			
			@ -16258,7 +16260,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -16750,7 +16752,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -16993,7 +16995,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -17179,7 +17181,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -17236,7 +17238,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -17293,7 +17295,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute parallel for simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target teams distribute parallel for simd
 | 
			
		||||
| 
						 | 
				
			
			@ -17422,7 +17424,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp simd // expected-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
#pragma omp simd // omp45-warning {{OpenMP only allows an ordered construct with the simd clause nested in a simd construct}}
 | 
			
		||||
    for (int i = 0; i < 10; ++i)
 | 
			
		||||
      ;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -17479,7 +17481,7 @@ void foo() {
 | 
			
		|||
    {
 | 
			
		||||
#pragma omp single
 | 
			
		||||
      {
 | 
			
		||||
	bar();
 | 
			
		||||
        bar();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -17536,7 +17538,7 @@ void foo() {
 | 
			
		|||
  }
 | 
			
		||||
#pragma omp target teams distribute simd
 | 
			
		||||
  for (int i = 0; i < 10; ++i) {
 | 
			
		||||
#pragma omp atomic // expected-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
#pragma omp atomic // omp45-error {{OpenMP constructs may not be nested inside a simd region}}OK
 | 
			
		||||
    ++a;
 | 
			
		||||
  }
 | 
			
		||||
#pragma omp target teams distribute simd
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue