Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][OpenMP] Fix directive in ActOnOpenMPTargetParallelForSimdDire… #85217

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

kparzysz
Copy link
Contributor

…ctive

The function ActOnOpenMPTargetParallelForSimdDirective gets the number of capture levels for OMPD_target_parallel_for, whereas the intended directive is OMPD_target_parallel_for_simd.

…ctive

The function `ActOnOpenMPTargetParallelForSimdDirective` gets the number
of capture levels for OMPD_target_parallel_for, whereas the intended
directive is OMPD_target_parallel_for_simd.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:openmp OpenMP related changes to Clang labels Mar 14, 2024
@kparzysz
Copy link
Contributor Author

I suspect this was a mistake, let me know if you intended to use the existing directive here.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 14, 2024

@llvm/pr-subscribers-clang

Author: Krzysztof Parzyszek (kparzysz)

Changes

…ctive

The function ActOnOpenMPTargetParallelForSimdDirective gets the number of capture levels for OMPD_target_parallel_for, whereas the intended directive is OMPD_target_parallel_for_simd.


Full diff: https://github.com/llvm/llvm-project/pull/85217.diff

1 Files Affected:

  • (modified) clang/lib/Sema/SemaOpenMP.cpp (+2-1)
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 0cc0cbacb37548..e9ad7bbde0f9b5 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -14366,7 +14366,8 @@ StmtResult Sema::ActOnOpenMPTargetParallelForSimdDirective(
   // The point of exit cannot be a branch out of the structured block.
   // longjmp() and throw() must not violate the entry/exit criteria.
   CS->getCapturedDecl()->setNothrow();
-  for (int ThisCaptureLevel = getOpenMPCaptureLevels(OMPD_target_parallel_for);
+  for (int ThisCaptureLevel =
+           getOpenMPCaptureLevels(OMPD_target_parallel_for_simd);
        ThisCaptureLevel > 1; --ThisCaptureLevel) {
     CS = cast<CapturedStmt>(CS->getCapturedStmt());
     // 1.2.2 OpenMP Language Terminology

Copy link
Member

@alexey-bataev alexey-bataev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG.
In the current implementation there is just no difference, they have same number of capture levels

@kparzysz kparzysz merged commit 5cf8cf3 into llvm:main Mar 14, 2024
3 of 4 checks passed
@kparzysz kparzysz deleted the users/kparzysz/parallel-for-simd branch March 14, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:openmp OpenMP related changes to Clang clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants