[PATCH] D118815: [Clang][Docs] Add documention for new OpenMP offloading driver

2022-02-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/docs/OffloadingDesign.rst:25 +Clang supports OpenMP target offloading to several different architectures such +as NVPTX, AMDGPU, and X86_64. Offloading code is generated by Clang and then +executed using the ``libomptarget`` runtim

[PATCH] D119392: [Clang][OpenMP][Sema] Remove support for floating point values in atomic compare

2022-02-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Tests? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119392/new/ https://reviews.llvm.org/D119392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D118632: [Clang]OpenMP] Add the codegen support for `atomic compare`

2022-02-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/atomic_compare_codegen.cpp:6 + +// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -target-cpu core2 -fopenmp-simd -fopenmp-version=51 -x c -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s +// %clang_

[PATCH] D116261: [Clang][OpenMP] Add support for compare capture in parser

2022-02-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Erroneous tests? Comment at: clang/lib/Sema/SemaOpenMP.cpp:11320 + bool MutexClauseEncountered = false; + llvm::SmallSet EncounteredAtomicKinds; for (const OMPClause *C : Clauses) { tianshilei1992 wrote: > ABataev wrote: > > ABatae

[PATCH] D116261: [Clang][OpenMP] Add support for compare capture in parser

2022-02-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D116261#3330732 , @tianshilei1992 wrote: > We don't have Sema yet, so there is no erroneous test. But you have the checks for the clauses, repeated several times in a construct. Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D116261: [Clang][OpenMP] Add support for compare capture in parser

2022-02-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116261/new/ https://reviews.llvm.org/D116261 ___

[PATCH] D119392: [Clang][OpenMP][Sema] Remove support for floating point values in atomic compare

2022-02-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119392/new/ https://reviews.llvm.org/D119392 ___

[PATCH] D120200: [Clang][OpenMP] Add Sema support for atomic compare capture

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Do we have ast print/dump tests for correct constructs? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120200/new/ https://reviews.llvm.org/D120200 ___ cfe-commits mailing list cf

[PATCH] D120225: [Clang][Sema] Check unexpected else statement in cond-update-stmt

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120225/new/ https://reviews.llvm.org/D120225 ___

[PATCH] D120200: [Clang][OpenMP] Add Sema support for atomic compare capture

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120200/new/ https://reviews.llvm.org/D120200 ___

[PATCH] D120252: [Clang][OpenMP] Fix wrong form of 'cond-update-stmt' in atomic_ast_print.cpp

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120252/new/ https://reviews.llvm.org/D120252 ___

[PATCH] D118632: [Clang]OpenMP] Add the codegen support for `atomic compare`

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG with a nit Comment at: clang/include/clang/AST/StmtOpenMP.h:2970 + } + /// Get + Expr *getCondExpr() { Fix comment Repository: rG LLVM Github Mon

[PATCH] D99436: [OPENMP]Fix PR49366: crash on VLAs in task untied regions.

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf9c3310d32c6: [OPENMP]Fix PR49366: crash on VLAs in task untied re

[PATCH] D118632: [Clang][OpenMP] Add the codegen support for `atomic compare`

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D118632#3336133 , @tianshilei1992 wrote: > In D118632#3336094 , @ABataev wrote: > >> LG with a nit > > Actually I got two question in the inline comments. Can you please take a > look

[PATCH] D118632: [Clang][OpenMP] Add the codegen support for `atomic compare`

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:6041 + llvm::Value *EVal = CGF.EmitScalarExpr(E->IgnoreImpCasts()); + llvm::Value *DVal = D ? CGF.EmitScalarExpr(D->IgnoreImpCasts()) : nullptr; + tianshilei1992 wrote: > tianshilei19

[PATCH] D118632: [Clang][OpenMP] Add the codegen support for `atomic compare`

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/atomic_compare_codegen.cpp:1990 +// CHECK-NEXT:[[DD:%.*]] = alloca double, align 8 +// CHECK-NEXT:[[TMP0:%.*]] = load i8, i8* [[CE]], align 1 +// CHECK-NEXT:[[TMP1:%.*]] = atomicrmw umin i8* [[CX]], i8 [[TMP

[PATCH] D118632: [Clang][OpenMP] Add the codegen support for `atomic compare`

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:6041 + llvm::Value *EVal = CGF.EmitScalarExpr(E->IgnoreImpCasts()); + llvm::Value *DVal = D ? CGF.EmitScalarExpr(D->IgnoreImpCasts()) : nullptr; + tianshilei1992 wrote: > ABataev wrot

[PATCH] D118632: [Clang][OpenMP] Add the codegen support for `atomic compare`

2022-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/atomic_compare_codegen.cpp:1990 +// CHECK-NEXT:[[DD:%.*]] = alloca double, align 8 +// CHECK-NEXT:[[TMP0:%.*]] = load i8, i8* [[CE]], align 1 +// CHECK-NEXT:[[TMP1:%.*]] = atomicrmw umin i8* [[CX]], i8 [[TMP

[PATCH] D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`

2022-02-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/StmtOpenMP.h:2835-2847 bool IsXLHSInRHSPart = false; /// Used for 'atomic update' or 'atomic capture' constructs. They may /// have atomic expressions of forms /// \code /// v = x; ; /// ; v = x;

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. > This is necessary for implementing features like conditional offloading and > ensuring that unhandled pragmas don't result in missing symbols. This behavior is part of the standard. > For offloading tests we can silently fail to the host without realizing that > offl

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D120353#3338647 , @jhuber6 wrote: > In D120353#3338589 , @ABataev wrote: > >>> This is necessary for implementing features like conditional offloading and >>> ensuring that unhandled p

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D120353#3338770 , @jhuber6 wrote: > In D120353#3338718 , @ABataev wrote: > >> In D120353#3338647 , @jhuber6 >> wrote: >> >>> But the main reas

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D120353#3340596 , @jhuber6 wrote: > In D120353#3340533 , @ABataev wrote: > >> In D120353#3338770 , @jhuber6 >> wrote: >> >>> In D120353#333871

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Could you add a test with the device clause too? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120353/new/ https://reviews.llvm.org/D120353 ___ cfe-commits mailing list cfe-commi

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D120353#3340749 , @jhuber6 wrote: > In D120353#3340744 , @ABataev wrote: > >> Could you add a test with the device clause too? > > Which clause exactly? `device(device_id)` Repositor

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. I assume it would be good to notify the user somehow about target regions, which may require execution on the host. Maybe add a note during the codegen phase? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120353/new/ http

[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

2022-02-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120353/new/ https://reviews.llvm.org/D120353 ___

[PATCH] D105297: [OPENMP]Fix PR50347: Mapping of global scope deep object fails.

2022-02-24 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG638938117aea: [OPENMP]Fix PR50347: Mapping of global scope deep ob

[PATCH] D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`

2022-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/StmtOpenMP.h:2917-2920 Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, - Expr *E, Expr *UE, Expr *D, Expr

[PATCH] D120290: [Clang][OpenMP] Add the codegen support for `atomic compare capture`

2022-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:6216 - KindsEncountered.contains(OMPC_capture)) { -IsCompareCapture = true; Kind = OMPC_compare; tianshilei1992 wrote: > ABataev wrote: > > Can this be fixed in a separate

[PATCH] D121101: [clang] Fix OpenMP critical hint parameter check

2022-03-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121101/new/ https://reviews.llvm.org/D121101 ___

[PATCH] D121077: Simplify OpenMP Lambda use

2022-03-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121077/new/ https://reviews.llvm.org/D121077 ___

[PATCH] D121156: [OPENMP]PR53344: Emit code for final update of the inscan reduction vars in worksharing loops.

2022-03-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, mikerice. Herald added subscribers: guansong, yaxunl. Herald added a project: All. ABataev requested review of this revision. Herald added a subscriber: sstefan1. Herald added a project: clang. Need to emit final update of the insc

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Could you check that it does not break the tests from https://github.com/clang-ykt/omptests? IIRC, "ref" was introduced to fix a bug with too early optimizations of the declare target variables defined in other modules. Check `t-same-name-definitions` especially, though

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Parse/ParseOpenMP.cpp:2134-2151 +Sema::DeclareTargetContextInfo *DTCI = +new Sema::DeclareTargetContextInfo(DKind, DTLoc); +if (HasClauses) + ParseOMPDeclareTargetClauses(*DTCI); // Skip the last ann

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Parse/ParseOpenMP.cpp:2134-2151 +Sema::DeclareTargetContextInfo *DTCI = +new Sema::DeclareTargetContextInfo(DKind, DTLoc); +if (HasClauses) + ParseOMPDeclareTargetClauses(*DTCI); // Skip the last ann

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Parse/ParseOpenMP.cpp:2134-2151 +Sema::DeclareTargetContextInfo *DTCI = +new Sema::DeclareTargetContextInfo(DKind, DTLoc); +if (HasClauses) + ParseOMPDeclareTargetClauses(*DTCI); // Skip the last ann

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D101030#2712738 , @jdoerfert wrote: > I'm testing a new version that does not allocate the structure on the heap. > Instead we copy it. It is really infrequent and it should be <40 bytes when > that happens, let's not over-op

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Looks good, but would be nice to check with sanitizers that there are no uses-after-delete. Comment at: clang/lib/CodeGen/CGDecl.cpp:2618-2619 + for (const Expr *E : D->varlists()) { +auto *DE = cast(E); +auto *VD = cast(DE->getDecl()); +i

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-04-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101030/new/ https://reviews.llvm.org/D101030 ___

[PATCH] D100673: [OPENMP]Fix PR49698: OpenMP declare mapper causes segmentation fault.

2021-04-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D100673#2714087 , @jdoerfert wrote: > I think this broke GridMini (https://github.com/meifeng/GridMini/tree/openmp) > :( Will investigate this on Monday. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D100673: [OPENMP]Fix PR49698: OpenMP declare mapper causes segmentation fault.

2021-04-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D100673#2714087 , @jdoerfert wrote: > I think this broke GridMini (https://github.com/meifeng/GridMini/tree/openmp) > :( Hmm, this app does not use mappers. Are you sure that this commit is the actual cause of the problem? A

[PATCH] D100673: [OPENMP]Fix PR49698: OpenMP declare mapper causes segmentation fault.

2021-04-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D100673#2716929 , @jdoerfert wrote: > In D100673#2716916 , @ABataev wrote: > >> In D100673#2714087 , @jdoerfert >> wrote: >> >>> I think this

[PATCH] D99689: [OPENMP]Add option -fopenmp-cuda-const-firstprivate to control address space of the corresponding global.

2021-04-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 340803. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99689/new/ https://reviews.llvm.org/D99689 Files: clang/include/clang/Basic/LangOptions.def clang/include/clang/Driver/

[PATCH] D99530: [OPENMP]Fix PR49098: respect firstprivate of declare target variable.

2021-04-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 340859. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99530/new/ https://reviews.llvm.org/D99530 Files: clang/lib/Sema/SemaOpenMP.cpp clang/test/OpenMP/target_firstprivate_c

[PATCH] D99436: [OPENMP]Fix PR49366: crash on VLAs in task untied regions.

2021-04-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 340887. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99436/new/ https://reviews.llvm.org/D99436 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/

[PATCH] D99350: [OPENMP]Fix PR49649: The introduction of $ref globals is not always valid.

2021-04-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 340894. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99350/new/ https://reviews.llvm.org/D99350 Files: clang/lib/CodeGen/CGOpenMPRuntime.cpp clang/test/OpenMP/declare_targe

[PATCH] D99762: [OPENMP]Fix PR49777: Clang should not try to specialize orphaned directives in device codegen.

2021-04-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 340909. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99762/new/ https://reviews.llvm.org/D99762 Files: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp clang/lib/CodeGen/CGOpenMPRu

[PATCH] D99350: [OPENMP]Fix PR49649: The introduction of $ref globals is not always valid.

2021-04-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99350#2721724 , @jdoerfert wrote: > The cast was never the problem but the fact that the `$ref` lives in the > global address space while the global value might be in the shared one. > D101030

[PATCH] D99530: [OPENMP]Fix PR49098: respect firstprivate of declare target variable.

2021-04-28 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc835630c25a4: [OPENMP]Fix PR49098: respect firstprivate of declare target variable. (authored by ABataev). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9953

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-04-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2726019 , @estewart08 wrote: > In reference to https://bugs.llvm.org/show_bug.cgi?id=48851, I do not see how > this helps SPMD mode with team privatization of declarations in-between > target teams and parallel regions.

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-04-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2726050 , @estewart08 wrote: > In D99432#2726025 , @ABataev wrote: > >> In D99432#2726019 , @estewart08 >> wrote: >> >>> In reference to h

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-04-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2726337 , @estewart08 wrote: > In D99432#2726060 , @ABataev wrote: > >> In D99432#2726050 , @estewart08 >> wrote: >> >>> In D99432#2726025

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-04-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2726588 , @estewart08 wrote: > In D99432#2726391 , @ABataev wrote: > >> In D99432#2726337 , @estewart08 >> wrote: >> >>> In D99432#2726060

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-04-30 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2726997 , @estewart08 wrote: > In D99432#2726845 , @ABataev wrote: > >> In D99432#2726588 , @estewart08 >> wrote: >> >>> In D99432#2726391

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-05-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:2618 +void CodeGenModule::EmitOMPAllocateDecl(const OMPAllocateDecl *D) { + for (Expr *E : const_cast(D)->varlists()) { +auto *DE = cast(E); Why need to remove constantness here? =

[PATCH] D101781: Fix assert on the variable which is used in omp clause is not marked as used

2021-05-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101781/new/ https://reviews.llvm.org/D101781 ___

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-05-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:2618 +void CodeGenModule::EmitOMPAllocateDecl(const OMPAllocateDecl *D) { + for (Expr *E : const_cast(D)->varlists()) { +auto *DE = cast(E); jdoerfert wrote: > ABataev wrote: > > Why nee

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-05-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:2618 +void CodeGenModule::EmitOMPAllocateDecl(const OMPAllocateDecl *D) { + for (Expr *E : const_cast(D)->varlists()) { +auto *DE = cast(E); jdoerfert wrote: > ABataev wrote: > > jdoerfe

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-05-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:2618 +void CodeGenModule::EmitOMPAllocateDecl(const OMPAllocateDecl *D) { + for (Expr *E : const_cast(D)->varlists()) { +auto *DE = cast(E); jdoerfert wrote: > ABataev wrote: > > jdoerfe

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-05-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101030/new/ https://reviews.llvm.org/D101030 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D101030: [OpenMP] Overhaul `declare target` handling

2021-05-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D101030#2736508 , @jdoerfert wrote: > I'll wait for @ggeorgakoudis to update the tests with the script, then I'll > adjust all clang tests again. FWIW, this also fixes an issue in OpenMC where > declare target triggered this:

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-05-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2736970 , @estewart08 wrote: > In D99432#2728788 , @ABataev wrote: > >> In D99432#2726997 , @estewart08 >> wrote: >> >>> In D99432#2726845

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-05-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2738859 , @estewart08 wrote: > In D99432#2736981 , @ABataev wrote: > >> In D99432#2736970 , @estewart08 >> wrote: >> >>> In D99432#2728788

[PATCH] D101911: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-05-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, estewart08. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a subscriber: sstefan1. Herald added a project: clang. Follow the more general patch for now, do not try to SPMDize the

[PATCH] D101911: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-05-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Hi Ethan, try this patch if it fixes the issue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101911/new/ https://reviews.llvm.org/D101911 ___ cfe-commits mailing list cfe-commit

[PATCH] D101973: [OpenMP][NFC] Remove SIMD check lines for non-simd tests

2021-05-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101973/new/ https://reviews.llvm.org/D101973 ___

[PATCH] D101976: [OpenMP] Unified entry point for SPMD & generic kernels in the device RTL

2021-05-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu:65-68 + asm volatile("barrier.sync %0;" + : + : "r"(barrier) + : "memory"); Why not `__syncthreads`? It is safer to use `

[PATCH] D101976: [OpenMP] Unified entry point for SPMD & generic kernels in the device RTL

2021-05-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Comment at: openmp/libomptarget/deviceRTLs/interface.h:421 + bool UseGenericStateMachine, + bool RequiresFullRu

[PATCH] D101911: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-05-10 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG230953d5771f: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode. (authored by ABataev). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D102180: [Clang][OpenMP] Emit dependent PreInits before directive.

2021-05-10 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/AST/StmtOpenMP.cpp:128-129 +llvm::function_ref Callback, +llvm::function_ref +OnTransformationCallback) { CurStmt = CurStmt->IgnoreContainers(); Do we need `bool` return in the callback? I se

[PATCH] D102180: [Clang][OpenMP] Emit dependent PreInits before directive.

2021-05-10 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:8975 +} +return false; })) No need for `return false;` Comment at: clang/lib/Sema/SemaOpenMP.cpp:12607 + PreInits.push_back

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/Stmt.h:2082-2083 /// Otherwise, or if the condition is value-dependent, returns None. Optional getNondiscardedCase(const ASTContext &Ctx) const; + Optional getNondiscardedCase(const ASTContext &Ctx);

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102251/new/ https://reviews.llvm.org/D102251 ___

[PATCH] D102251: Suppress Deferred Diagnostics in discarded statements.

2021-05-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D102251#2751226 , @erichkeane wrote: > In D102251#2751101 , @ABataev wrote: > >> LG > > Thanks! I'm going to give @yaxunl a day to take a look that this, > particularly since the onl

[PATCH] D116764: [clang][OpenMP5.1] Initial parsing/sema for 'indirect' clause

2022-01-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Sema/Sema.h:10338 +Expr *IndirectExpr = nullptr; +bool IsIndirect = false; + Can you use `Optional` instead of `Expr *` and `bool`? Comment at: clang/lib/Parse/ParseOpenMP.c

[PATCH] D116764: [clang][OpenMP5.1] Initial parsing/sema for 'indirect' clause

2022-01-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG with a nit Comment at: clang/lib/Parse/ParseOpenMP.cpp:1844 + if (!IsDeviceTypeClause && !IsIndirectClause && + DTCI.Kind == OMPD_begin_declare_target) {

[PATCH] D115902: [OPENMP]Look through member function call base during implicit DSA analysis.

2021-12-16 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, mikerice, ddpagan. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a subscriber: sstefan1. Herald added a project: clang. Need to look through the base of the member function call

[PATCH] D115902: [OPENMP]Look through member function call base during implicit DSA analysis.

2021-12-17 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG667485413fd3: [OPENMP]Look through member function call base during implicit DSA analysis. (authored by ABataev). Repository: rG LLVM Github Monor

[PATCH] D115573: [Clang][OpenMP] Return error ahead of time if there are multiple mutex clauses in atomic directive

2021-12-20 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115573/new/ https://reviews.llvm.org/D115573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[PATCH] D116068: [NFC][Clang] Move function implementation of `OpenMPAtomicUpdateChecker` into anonymous namespace

2021-12-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116068/new/ https://reviews.llvm.org/D116068 ___

[PATCH] D115561: [Clang][OpenMP] Add the support for atomic compare in parser

2021-12-23 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:2234 +/// In this example directive '#pragma omp atomic' has 'compare' clause. +class OMPCompareClause : public OMPClause { +public: `final` Comment at: clang/lib

[PATCH] D115561: [Clang][OpenMP] Add the support for atomic compare in parser

2021-12-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115561/new/ https://reviews.llvm.org/D115561 ___

[PATCH] D99436: [OPENMP]Fix PR49366: crash on VLAs in task untied regions.

2021-12-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 396524. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99436/new/ https://reviews.llvm.org/D99436 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/

[PATCH] D105297: [OPENMP]Fix PR50347: Mapping of global scope deep object fails.

2021-12-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 396531. ABataev added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105297/new/ https://reviews.llvm.org/D105297 Files: clang/lib/CodeGen/CGOpenMPRuntime.cpp clang/test/OpenMP/reduction_i

[PATCH] D98812: [OPENMP]Map data field with l-value reference types.

2021-03-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, jyu2, mikerice. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added subscribers: openmp-commits, sstefan1. Herald added projects: clang, OpenMP. Added initial support dfor the mapping

[PATCH] D98812: [OPENMP]Map data field with l-value reference types.

2021-03-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 331623. ABataev added a comment. Rebase + fixes for references to complex data structures mapping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98812/new/ https://reviews.llvm.org/D98812 Files: clang/lib/Cod

[PATCH] D98812: [OPENMP]Map data field with l-value reference types.

2021-03-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 332296. ABataev added a comment. Rebase + fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98812/new/ https://reviews.llvm.org/D98812 Files: clang/lib/CodeGen/CGOpenMPRuntime.cpp clang/test/OpenMP/targe

[PATCH] D99280: [OPENMP]Fix PR48571: critical/master in outlined contexts cause crash.

2021-03-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, mikerice. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a subscriber: sstefan1. Herald added a project: clang. If emit inlined region for master/critical directives, no need to

[PATCH] D99280: [OPENMP]Fix PR48571: critical/master in outlined contexts cause crash.

2021-03-24 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7654bb6303d2: [OPENMP]Fix PR48571: critical/master in outlined contexts cause crash. (authored by ABataev). Repository: rG LLVM Github Monorepo C

[PATCH] D99288: [OPENMP]Fix PR49468: Declare target should allow empty sequences and namespaces.

2021-03-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, mikerice. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a subscriber: sstefan1. Herald added a project: clang. The emty declare target/end declare target region should not cause

[PATCH] D99288: [OPENMP]Fix PR49468: Declare target should allow empty sequences and namespaces.

2021-03-24 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9e9f6eba84f0: [OPENMP]Fix PR49468: Declare target should allow empty sequences and namespaces. (authored by ABataev). Repository: rG LLVM Github M

[PATCH] D99297: [OPENMP]Fix PR49636: Assertion `(!Entry.getAddress() || Entry.getAddress() == Addr) && "Resetting with the new address."' failed.

2021-03-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added a reviewer: jdoerfert. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a project: clang. The original issue is caused by the fact that the variable is allocated with incorrect type i1 instead of i8. Th

[PATCH] D99350: [OPENMP]Fix PR49649: The introduction of $ref globals is not always valid.

2021-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: jdoerfert, mikerice. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a project: clang. Need to emit the reference in the global address space and the referenced to static variable should be

[PATCH] D98135: [OpenMP][InstrProfiling] Fix a missing instr profiling counter

2021-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D98135#2650914 , @lxfind wrote: > @ABataev, wondering if you have a timeline on this? > Missing counters from OMP functions sometimes cause llvm-cov to crash because > of data inconsistency. Cannot answer right now. It would b

[PATCH] D99372: [OpenMP][NFC] Generate check lines with update script

2021-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/cancel_codegen.cpp:83 +// OMP-LABEL: @main( +// OMP-NEXT: entry: +// OMP-NEXT:[[RETVAL:%.*]] = alloca i32, align 4 I think it may fail in release mode, where no symbol names are generated. Need to

[PATCH] D98135: [OpenMP][InstrProfiling] Fix a missing instr profiling counter

2021-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D98135#2651193 , @lxfind wrote: > In D98135#2650940 , @ABataev wrote: > >> In D98135#2650914 , @lxfind wrote: >> >>> @ABataev, wondering if you ha

[PATCH] D98135: [OpenMP][InstrProfiling] Fix a missing instr profiling counter

2021-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98135/new/ https://reviews.llvm.org/D98135 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-03-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added a reviewer: jdoerfert. Herald added subscribers: guansong, yaxunl. ABataev requested review of this revision. Herald added a subscriber: sstefan1. Herald added a project: clang. Need to perform general analysis on SPMD kernels to correctly identify the

[PATCH] D99432: [OPENMP]Fix PR48851: the locals are not globalized in SPMD mode.

2021-03-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D99432#2653474 , @jdoerfert wrote: > Can we please always do the globalization, even in the `target teams > distribute parallel for` case you need it if a thread shares the address of a > local variable with the team and anoth

<    16   17   18   19   20   21   22   23   >