[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: > > Aldo, update OpenMPSupport page > > Question about this. I see that the table for `OpenMP 6.0 Implementation > Details` chapter has an entry for `Loop transformation constructs`. Should > the `#pragma omp stripe` be listed here as a bullet item? Do you have a > prefer

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
@@ -14205,6 +14212,15 @@ static void collectLoopStmts(Stmt *AStmt, MutableArrayRef LoopStmts) { "Expecting a loop statement for each affected loop"); } +/// Build and return a DeclRefExpr for the floor induction variable using the +/// SemaRef and the provided parame

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
@@ -14205,6 +14212,15 @@ static void collectLoopStmts(Stmt *AStmt, MutableArrayRef LoopStmts) { "Expecting a loop statement for each affected loop"); } +/// Build and return a DeclRefExpr for the floor induction variable using the +/// SemaRef and the provided parame

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
@@ -1463,6 +1463,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, case 52: Builder.defineMacro("_OPENMP", "202111"); break; +case 60: + Builder.defineMacro("_OPENMP", "202411"); + break; alexey-bataev wrote: Must

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
@@ -14342,22 +14358,21 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, Stmt *LoopStmt = LoopStmts[I]; // Commonly used variables. One of the constraints of an AST is that every -// node object must appear at most once, hence we define lamdas t

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev commented: Update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/119891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2025-01-17 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/119891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-10 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Rebase? And commit after rebase, it is approved already https://github.com/llvm/llvm-project/pull/121814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] codegen support for masked combined construct masked taskloop simd (PR #121916)

2025-01-10 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG https://github.com/llvm/llvm-project/pull/121916 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] codegen support for masked combined construct masked taskloop (PR #121914)

2025-01-10 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG https://github.com/llvm/llvm-project/pull/121914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop simd. (PR #121746)

2025-01-10 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG https://github.com/llvm/llvm-project/pull/121746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-09 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/121814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-09 Thread Alexey Bataev via cfe-commits
@@ -17153,11 +17155,25 @@ OMPClause *SemaOpenMP::ActOnOpenMPVarListClause(OpenMPClauseKind Kind, case OMPC_has_device_addr: Res = ActOnOpenMPHasDeviceAddrClause(VarList, Locs); break; - case OMPC_allocate: -Res = ActOnOpenMPAllocateClause(Data.DepModOrTailExpr,

[clang] [OpenMP] Change default version to OMP6.0. (PR #122108)

2025-01-09 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev commented: Need to change the caption and summary of PR, I assume https://github.com/llvm/llvm-project/pull/122108 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-08 Thread Alexey Bataev via cfe-commits
@@ -11824,10 +11824,14 @@ void OMPClauseReader::VisitOMPMapClause(OMPMapClause *C) { } void OMPClauseReader::VisitOMPAllocateClause(OMPAllocateClause *C) { - C->setAllocatorModifier(Record.readEnum()); + C->setFirstAllocateModifier( + static_cast(Record.readInt())); +

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-08 Thread Alexey Bataev via cfe-commits
@@ -7924,10 +7924,12 @@ void OMPClauseWriter::VisitOMPMapClause(OMPMapClause *C) { void OMPClauseWriter::VisitOMPAllocateClause(OMPAllocateClause *C) { Record.push_back(C->varlist_size()); - Record.writeEnum(C->getAllocatorModifier()); + Record.push_back(C->getFirstAlloca

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-08 Thread Alexey Bataev via cfe-commits
@@ -4530,32 +4530,89 @@ static bool parseStepSize(Parser &P, SemaOpenMP::OpenMPVarListDataTy &Data, } /// Parse 'allocate' clause modifiers. -/// If allocator-modifier exists, return an expression for it and set -/// Data field noting modifier was specified. -/// +/// I

[clang] [OpenMP] Allow GPUs to be targeted directly via `-fopenmp`. (PR #122149)

2025-01-08 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: > What code generation path would be used in this case? The GPU code generation > or regular host OpenMP? gpu device code https://github.com/llvm/llvm-project/pull/122149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [OpenMP] Allow GPUs to be targeted directly via `-fopenmp`. (PR #122149)

2025-01-08 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Maybe just turn on OpenMPIsTargetDevice if `gpu target + -fopenmp` is specified? https://github.com/llvm/llvm-project/pull/122149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [OpenMP] Change default version to OMP6.0. (PR #122108)

2025-01-08 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: > > Not sure this level of support is enough to make 6.0 the default version. > > We're missing support for some 5.2 features still > > That's what I thought! So the macro should continue being set to `202011? I think yes, unless we support most of the 6.0 features https:

[clang] [OpenMP] Change default version to OMP6.0. (PR #122108)

2025-01-08 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Not sure this level of support is enough to make 6.0 the default version. We're missing support for some 5.2 features still https://github.com/llvm/llvm-project/pull/122108 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [OpenMP] [Debug] Debug support for work sharing iterator variable (PR #122047)

2025-01-08 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Maybe it fixes debug info, but definitely breaks some of the OpenMP support https://github.com/llvm/llvm-project/pull/122047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop (PR #121741)

2025-01-07 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG https://github.com/llvm/llvm-project/pull/121741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-07 Thread Alexey Bataev via cfe-commits
@@ -4530,32 +4530,87 @@ static bool parseStepSize(Parser &P, SemaOpenMP::OpenMPVarListDataTy &Data, } /// Parse 'allocate' clause modifiers. -/// If allocator-modifier exists, return an expression for it and set -/// Data field noting modifier was specified. -/// +/// I

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-07 Thread Alexey Bataev via cfe-commits
@@ -4530,32 +4530,87 @@ static bool parseStepSize(Parser &P, SemaOpenMP::OpenMPVarListDataTy &Data, } /// Parse 'allocate' clause modifiers. -/// If allocator-modifier exists, return an expression for it and set -/// Data field noting modifier was specified. -/// +/// I

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-07 Thread Alexey Bataev via cfe-commits
@@ -4530,32 +4530,87 @@ static bool parseStepSize(Parser &P, SemaOpenMP::OpenMPVarListDataTy &Data, } /// Parse 'allocate' clause modifiers. -/// If allocator-modifier exists, return an expression for it and set -/// Data field noting modifier was specified. -/// +/// I

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-07 Thread Alexey Bataev via cfe-commits
@@ -5285,6 +5285,7 @@ static void checkAllocateClauses(Sema &S, DSAStackTy *Stack, } for (OMPClause *C : AllocateRange) { auto *AC = cast(C); +// TODO: Check alignment? alexey-bataev wrote: What are the missing checks here? https://github.com/llv

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop (PR #121741)

2025-01-07 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Also update ReleaseNotes.rst here and in other patches https://github.com/llvm/llvm-project/pull/121741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Add 'align' modifier for 'allocate' clause (PR #121814)

2025-01-06 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/121814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop (PR #121741)

2025-01-06 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/121741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] codegen support for masked combined construct parallel masked taskloop simd. (PR #121746)

2025-01-06 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Please update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/121746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2025-01-02 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,269 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -1179,6 +1179,13 @@ def OMP_Tile : Directive<"tile"> { let association = AS_Loop; let category = CA_Executable; } +def OMP_Stripe : Directive<"stripe"> { + let allowedOnceClauses = [ +VersionedClause, alexey-bataev wrote: Sounds good https://githu

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -5621,6 +5623,81 @@ class OMPTileDirective final : public OMPLoopTransformationDirective { } }; +class OMPStripeDirective final : public OMPLoopTransformationDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + + /// Default list of offse

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -1179,6 +1179,13 @@ def OMP_Tile : Directive<"tile"> { let association = AS_Loop; let category = CA_Executable; } +def OMP_Stripe : Directive<"stripe"> { + let allowedOnceClauses = [ +VersionedClause, alexey-bataev wrote: Yes, should be 60 https:/

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,269 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -14477,6 +14484,279 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPStripeDirective(ArrayRef Clauses, +

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -14477,6 +14484,279 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPStripeDirective(ArrayRef Clauses, +

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -14477,6 +14484,279 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPStripeDirective(ArrayRef Clauses, +

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -14477,6 +14484,279 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPStripeDirective(ArrayRef Clauses, +

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -14477,6 +14484,279 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPStripeDirective(ArrayRef Clauses, +

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -14477,6 +14484,279 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef Clauses, buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPStripeDirective(ArrayRef Clauses, +

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -5621,6 +5623,81 @@ class OMPTileDirective final : public OMPLoopTransformationDirective { } }; +class OMPStripeDirective final : public OMPLoopTransformationDirective { alexey-bataev wrote: Add a comment describing the supported construct https://gith

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
@@ -5621,6 +5623,81 @@ class OMPTileDirective final : public OMPLoopTransformationDirective { } }; +class OMPStripeDirective final : public OMPLoopTransformationDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + + /// Default list of offse

[clang] [llvm] [Clang] [OpenMP] Add support for '#pragma omp stripe'. (PR #119891)

2024-12-24 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Aldo, update OpenMPSupport page https://github.com/llvm/llvm-project/pull/119891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Codegen support for masked combined construct (PR #120520)

2024-12-24 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Split into several separate patches, one for each directive https://github.com/llvm/llvm-project/pull/120520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-17 Thread Alexey Bataev via cfe-commits
@@ -174,6 +177,8 @@ struct OMPContext { BitVector ActiveTraits = BitVector(unsigned(TraitProperty::Last) + 1); SmallVector ConstructTraits; + static int DeviceNum; + static StringRef DeviceNumID; alexey-bataev wrote: This is the main question. Can it be

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-17 Thread Alexey Bataev via cfe-commits
@@ -11774,6 +11774,9 @@ def err_omp_clause_requires_dispatch_construct : Error< "'%0' clause requires 'dispatch' context selector">; def err_omp_append_args_with_varargs : Error< "'append_args' is not allowed with varargs functions">; +def warn_omp_dispatch_clause_novariant

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-17 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,269 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-16 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Do not use force push https://github.com/llvm/llvm-project/pull/118471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-16 Thread Alexey Bataev via cfe-commits
@@ -15629,6 +15629,34 @@ ExprResult SemaOpenMP::VerifyPositiveIntegerConstantInClause( return ICE; } +void SemaOpenMP::ActOnOpenMPDeviceNum(Expr *DeviceNumExpr) { + llvm::APSInt Result; + Expr::EvalResult EvalResult; + // Strip implicit casts from the expression + Devic

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-16 Thread Alexey Bataev via cfe-commits
@@ -174,6 +177,8 @@ struct OMPContext { BitVector ActiveTraits = BitVector(unsigned(TraitProperty::Last) + 1); SmallVector ConstructTraits; + static int DeviceNum; + static StringRef DeviceNumID; alexey-bataev wrote: Not sure static is correct here htt

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-16 Thread Alexey Bataev via cfe-commits
@@ -2903,7 +2903,10 @@ TargetOMPContext::TargetOMPContext( const FunctionDecl *CurrentFunctionDecl, ArrayRef ConstructTraits) : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice, - ASTCtx.getTargetInfo().getTriple()), + ASTCtx.getT

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,264 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #117904)

2024-12-13 Thread Alexey Bataev via cfe-commits
@@ -11774,6 +11774,9 @@ def err_omp_clause_requires_dispatch_construct : Error< "'%0' clause requires 'dispatch' context selector">; def err_omp_append_args_with_varargs : Error< "'append_args' is not allowed with varargs functions">; +def warn_omp_dispatch_clause_novariant

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-11 Thread Alexey Bataev via cfe-commits
@@ -15629,6 +15629,34 @@ ExprResult SemaOpenMP::VerifyPositiveIntegerConstantInClause( return ICE; } +void SemaOpenMP::ActOnOpenMPDeviceNum(Expr *DeviceNumExpr) { + llvm::APSInt Result; + Expr::EvalResult EvalResult; + // Strip implicit casts from the expression + Devic

[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

2024-12-11 Thread Alexey Bataev via cfe-commits
@@ -15629,6 +15629,34 @@ ExprResult SemaOpenMP::VerifyPositiveIntegerConstantInClause( return ICE; } +void SemaOpenMP::ActOnOpenMPDeviceNum(Expr *DeviceNumExpr) { + llvm::APSInt Result; + Expr::EvalResult EvalResult; + // Strip implicit casts from the expression + Devic

[clang] [Driver][OpenMP] Fix OpenMP target-toolchain-option parser (PR #115375)

2024-12-06 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev closed https://github.com/llvm/llvm-project/pull/115375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -621,6 +621,11 @@ bool clang::isOpenMPParallelDirective(OpenMPDirectiveKind DKind) { llvm::is_contained(getLeafConstructs(DKind), OMPD_parallel); } +bool clang::isOpenMPDispatchDirective(OpenMPDirectiveKind DKind) { + return DKind == OMPD_dispatch || + ll

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-12-05 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,263 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [Driver][OpenMP] Fix OpenMP target-toolchain-option parser (PR #115375)

2024-11-29 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/115375 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -11769,6 +11769,8 @@ def err_omp_clause_requires_dispatch_construct : Error< "'%0' clause requires 'dispatch' context selector">; def err_omp_append_args_with_varargs : Error< "'append_args' is not allowed with varargs functions">; +def warn_omp_dispatch_clause_novariant

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev edited https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -5965,6 +5967,244 @@ static bool teamsLoopCanBeParallelFor(Stmt *AStmt, Sema &SemaRef) { return Checker.teamsLoopCanBeParallelFor(); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { + + Expr *SubExpr = Cond->IgnoreParenImpCasts(); + + if (auto *DeclRef = dy

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -4452,6 +4452,11 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +void CodeGenFunction::EmitOMPDispatchDirective(const OMPDispatchDirective &S) { + alexey-bataev wrote: Drop empty line https://gith

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
@@ -417,7 +417,8 @@ void CodeGenFunction::EmitStmt(const Stmt *S, ArrayRef Attrs) { EmitOMPInteropDirective(cast(*S)); break; case Stmt::OMPDispatchDirectiveClass: -CGM.ErrorUnsupported(S, "OpenMP dispatch directive"); +// CGM.ErrorUnsupported(S, "OpenMP disp

[clang] [llvm] Support for dispatch construct (Sema & Codegen) support. (PR #117904)

2024-11-27 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev commented: Please, reformat your changes, follow coding standard, use nullptr instead of NULL, etc. https://github.com/llvm/llvm-project/pull/117904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [Clang] [Parser] Fixing all callers of `ParseExternalDeclaration` that didn't parse gnu attributes (PR #117148)

2024-11-25 Thread Alexey Bataev via cfe-commits
@@ -2314,10 +2314,12 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( // Here we expect to see some function declaration. if (AS == AS_none) { assert(TagType == DeclSpec::TST_unspecified); -ParsedAttributes EmptyDeclSpec

[clang] [flang] [llvm] seq_cst is allowed in Flush since OpenMP 5.1. (PR #114072)

2024-11-21 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/114072 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP][NFC] Move 'allocate' clause modifier parsing into fun… (PR #115775)

2024-11-11 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/115775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix for codegen Crash in Clang when using locator omp_all_memory with depobj construct (PR #114221)

2024-11-08 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/114221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Add 'allocator' modifier for 'allocate' clause. (PR #114883)

2024-11-05 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG with a nit. Update OpenMPSupport.rst https://github.com/llvm/llvm-project/pull/114883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang][OpenMP] Add 'allocator' modifier for 'allocate' clause. (PR #114883)

2024-11-05 Thread Alexey Bataev via cfe-commits
@@ -4539,6 +4539,8 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind, bool NeedRParenForLinear = false; BalancedDelimiterTracker LinearT(*this, tok::l_paren, tok::annot_pragma_openmp_end); + BalancedDelimiterTracker AllocateT(*

[clang] [clang][OpenMP] Add 'allocator' modifier for 'allocate' clause. (PR #114883)

2024-11-05 Thread Alexey Bataev via cfe-commits
@@ -2242,9 +2247,16 @@ void OMPClausePrinter::VisitOMPAllocateClause(OMPAllocateClause *Node) { if (Node->varlist_empty()) return; OS << "allocate"; + OpenMPAllocateClauseModifier Modifier = Node->getAllocatorModifier(); if (Expr *Allocator = Node->getAllocator())

[clang] [flang] [llvm] Enable seq_cst Clause for flush Directive in OpenMP (PR #114072)

2024-11-04 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: Also, would be good to update clang WhatsNew and OpenMP status docs to reflect support for the new functionality https://github.com/llvm/llvm-project/pull/114072 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] Fix for codegen Crash in Clang when using locator omp_all_memory with depobj construct (PR #114221)

2024-11-04 Thread Alexey Bataev via cfe-commits
@@ -36,6 +36,8 @@ int main(int argc, char **argv) { #pragma omp depobj(b) update(mutexinoutset) #pragma omp depobj(a) depend(iterator(char *p = argv[argc]:argv[0]:-1), out: p[0]) (void)tmain(a), tmain(b); + omp_depend_t obj; +#pragma omp depobj(obj) depend(inout: omp_all_m

[clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030)

2024-10-08 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/92030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP][test] Use x86_64-linux-gnu triple for test referencing avx512f feature (PR #111337)

2024-10-07 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/111337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [openmp] [Clang][OpenMP] Add permutation clause (PR #92030)

2024-10-04 Thread Alexey Bataev via cfe-commits
@@ -16029,6 +16074,44 @@ OMPClause *SemaOpenMP::ActOnOpenMPSizesClause(ArrayRef SizeExprs, SanitizedSizeExprs); } +OMPClause *SemaOpenMP::ActOnOpenMPPermutationClause(ArrayRef PermExprs, +Sour

[clang] [clang] Fix static analyzer concerns (PR #110243)

2024-09-27 Thread Alexey Bataev via cfe-commits
@@ -9195,7 +9195,7 @@ static bool checkOpenMPIterationSpace( SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), diag::note_omp_collapse_ordered_expr) << 0 << CollapseLoopCountExpr->getSourceRange(); - else + else if (OrderedLoop

  1   2   3   4   5   6   7   8   9   10   >