[clang] [llvm] [Offload][CUDA] Add initial cuda_runtime.h overlay (PR #94821)

2024-06-07 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert created https://github.com/llvm/llvm-project/pull/94821 This provides the header overlay for cuda_runtime.h which is found before any CUDA installation (none is necessary). Some basic APIs are defined in terms of the omp_target_* ones, but with the pending LLVM/Offl

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-07 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: There seems to be some trouble with NVIDIA offload (I tested mainly AMDGPU) and f128, I'll make sure that works too. The nits are easy to address, I just copied the style around. I'll also add a IR test to match the new runtime calls and kernel argument passing. > Will kernels

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-07 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,31 @@ +/*===-- LLVM/Offload helpers for kernel languages (CUDA/HIP) -*- c++ -*-=== + * + * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. + * See https://llvm.org/LICENSE.txt for license information. + * SPDX-License-Identifier: Apach

[clang] [llvm] [Offload][CUDA] Add initial cuda_runtime.h overlay (PR #94821)

2024-06-07 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: This includes the changes of #94549, I need to learn how to do stacked PRs... https://github.com/llvm/llvm-project/pull/94821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [Offload][CUDA] Add initial cuda_runtime.h overlay (PR #94821)

2024-06-09 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang++ -foffload-via-llvm --offload-arch=native %s -o %t +// RUN: %t | %fcheck-generic + +// UNSUPPORTED: aarch64-unknown-linux-gnu +// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO +// UNSUPPORTED: x86_64-pc-linux-gnu +// UNSUPPORTED: x86_64-pc-linux-gnu-

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 36618e65d94ffa3e83464b7d19ff6cd7d5855abf Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 5 Jun 2024 16:51:51 -0700 Subject: [PATCH 1/3] [Offload][NFCI] Initialize the KernelArgsTy to default

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 36618e65d94ffa3e83464b7d19ff6cd7d5855abf Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 5 Jun 2024 16:51:51 -0700 Subject: [PATCH 1/3] [Offload][NFCI] Initialize the KernelArgsTy to default

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 36618e65d94ffa3e83464b7d19ff6cd7d5855abf Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 5 Jun 2024 16:51:51 -0700 Subject: [PATCH 1/3] [Offload][NFCI] Initialize the KernelArgsTy to default

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 36618e65d94ffa3e83464b7d19ff6cd7d5855abf Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 5 Jun 2024 16:51:51 -0700 Subject: [PATCH 1/3] [Offload][NFCI] Initialize the KernelArgsTy to default

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-11 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: > Should the NFCI changes (like initializing struct fields) be put into a > separate PR? Done. https://github.com/llvm/llvm-project/pull/95116 https://github.com/llvm/llvm-project/pull/95117 > Will kernels in TUs compiled with -foffload-via-llvm be interoperable with > code

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 36618e65d94ffa3e83464b7d19ff6cd7d5855abf Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 5 Jun 2024 16:51:51 -0700 Subject: [PATCH 1/3] [Offload][NFCI] Initialize the KernelArgsTy to default

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-12 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 094dbf3e01a62136db6be1afd6194f1d84ca8494 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 12 Jun 2024 02:14:32 -0700 Subject: [PATCH 1/3] [Offload][AMDGPU] Impose more restrictions for implicit

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-12 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From 094dbf3e01a62136db6be1afd6194f1d84ca8494 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 12 Jun 2024 02:14:32 -0700 Subject: [PATCH 1/3] [Offload][AMDGPU] Impose more restrictions for implicit

[clang] [llvm] [Offload][CUDA] Add initial cuda_runtime.h overlay (PR #94821)

2024-06-13 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94821 >From d06585044bd6d2dd76d6110bce933e01fd4b333e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 3 Jun 2024 19:52:12 -0700 Subject: [PATCH 1/2] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload M

[clang] [llvm] [Offload] Introduce the concept of "default streams" (PR #95371)

2024-06-13 Thread Johannes Doerfert via cfe-commits
@@ -1125,6 +1125,22 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, CmdArgs.push_back("__clang_openmp_device_functions.h"); } + if (Args.hasArg(options::OPT_foffload_via_llvm)) { +// Add llvm_wrappers/* to our system include path. This

[clang] [llvm] [Offload] Introduce the concept of "default streams" (PR #95371)

2024-06-13 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert created https://github.com/llvm/llvm-project/pull/95371 The offload APIs, and the CUDA wrappers in clang, now support "default streams" per thread (and per device). It should be per context but we don't really expose that concept yet. The KernelArguments allow an LLV

[clang] [llvm] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload (PR #94549)

2024-06-13 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/94549 >From d06585044bd6d2dd76d6110bce933e01fd4b333e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 3 Jun 2024 19:52:12 -0700 Subject: [PATCH] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload MIME-

[clang] [llvm] [Offload] Introduce the concept of "default streams" (PR #95371)

2024-06-13 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/95371 >From d06585044bd6d2dd76d6110bce933e01fd4b333e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 3 Jun 2024 19:52:12 -0700 Subject: [PATCH 1/3] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload M

[clang] [llvm] [Offload] Introduce the concept of "default streams" (PR #95371)

2024-06-15 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/95371 >From d06585044bd6d2dd76d6110bce933e01fd4b333e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 3 Jun 2024 19:52:12 -0700 Subject: [PATCH 1/3] [Offload][CUDA] Allow CUDA kernels to use LLVM/Offload M

[clang] [llvm] [OpenMP] Remove 'minncta' attributes from NVPTX kernels (PR #88398)

2024-04-15 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: LG, I misread the existing code in clang. https://github.com/llvm/llvm-project/pull/88398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Remove 'minncta' attributes from NVPTX kernels (PR #88398)

2024-04-15 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG https://github.com/llvm/llvm-project/pull/88398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-15 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: This patch is huge, and just skimming over it shows various places that could be split off, and others that should not make it to the review stage (commented out code). Please update. https://github.com/llvm/llvm-project/pull/80343 __

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-15 Thread Johannes Doerfert via cfe-commits
@@ -145,6 +145,8 @@ static bool isValidWorkshareLoopScheduleType(OMPScheduleType SchedType) { } #endif +Function *GLOBAL_ReductionFunc = nullptr; jdoerfert wrote: We should (almost) never have globals flying around. What is going on here? https://github.com

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-15 Thread Johannes Doerfert via cfe-commits
@@ -99,14 +100,20 @@ class OpenMPIRBuilderConfig { /// expanded. std::optional IsGPU; - // Flag for specifying if offloading is mandatory. + /// Flag for specifying if LLVMUsed information should be emitted. + std::optional EmitLLVMUsed; jdoerfert wrote

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-15 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/80343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-15 Thread Johannes Doerfert via cfe-commits
@@ -607,15 +621,17 @@ class OpenMPIRBuilder { /// Generator for '#omp barrier' /// /// \param Loc The location where the barrier directive was encountered. - /// \param DK The kind of directive that caused the barrier. + /// \param Kind The kind of directive that caused

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-15 Thread Johannes Doerfert via cfe-commits
@@ -2096,15 +2102,1408 @@ OpenMPIRBuilder::createSection(const LocationDescription &Loc, /*IsCancellable*/ true); } -/// Create a function with a unique name and a "void (i8*, i8*)" signature in -/// the given module and return it. -Function *get

[clang] [llvm] [OpenMP] Ensure the actual kernel is annotated with launch bounds (PR #99927)

2024-07-23 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert closed https://github.com/llvm/llvm-project/pull/99927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang][Driver] Introduce -fopenmp-targets offloading option (PR #100152)

2024-07-24 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: I think we can/should go with the "--offload" set of flags, and potentially have an "--offload-targets=..." version that clang is missing. The latter is mostly not needed, as --offload-arch=..." is pretty good, but there are cases you want to make it explicit to pass on additi

[clang] [flang] [Flang][Driver] Introduce -fopenmp-targets offloading option (PR #100152)

2024-07-25 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: > One related question I have - does Flang compile for one offload model or can > it mix those (let's say compile sources with mixed OpenACC and OpenMP > pragmas)? If mixing is allowed then it may also make sense to add a way of > setting the target per programming model. But

[clang] [llvm] [OpenMP] Ensure the actual kernel is annotated with launch bounds (PR #99927)

2024-07-22 Thread Johannes Doerfert via cfe-commits
@@ -4569,7 +4569,17 @@ OpenMPIRBuilder::createTargetInit(const LocationDescription &Loc, bool IsSPMD, Constant *MayUseNestedParallelismVal = ConstantInt::getSigned(Int8, true); Constant *DebugIndentionLevelVal = ConstantInt::getSigned(Int16, 0); - Function *Kernel = Buil

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/89007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: I just read over this and left some comments. https://github.com/llvm/llvm-project/pull/89007 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [WIP] Expand variadic functions in IR (PR #89007)

2024-04-29 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1026 @@ +//===-- ExpandVariadicsPass.cpp *- C++ -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apach

[clang] [llvm] [Offload] Introduce the concept of "default streams" (PR #95371)

2024-08-30 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/95371 >From 34c8bf739040b9d3d0bf625cdadf12b282249ccf Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Fri, 7 Jun 2024 17:06:02 -0700 Subject: [PATCH 1/2] [Offload][CUDA] Add initial cuda_runtime.h overlay This

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/87009 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
@@ -34,38 +33,10 @@ #include #include -struct PluginManager; - -/// Plugin adaptors should be created via `PluginAdaptorTy::create` which will -/// invoke the constructor and call `PluginAdaptorTy::init`. Eventual errors are -/// reported back to the caller, otherwise a val

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
@@ -3476,3 +3472,9 @@ void *AMDGPUDeviceTy::allocate(size_t Size, void *, TargetAllocTy Kind) { } // namespace target } // namespace omp } // namespace llvm + +extern "C" { +llvm::omp::target::plugin::GenericPluginTy *createPlugin_amdgpu() { jdoerfert wrote:

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. I left minor comments. This LGTM, assuming it passes our tests. https://github.com/llvm/llvm-project/pull/87009 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
@@ -92,10 +65,10 @@ struct PluginManager { std::make_unique(TgtBinDesc, TgtDeviceImage)); } - /// Initialize as many devices as possible for this plugin adaptor. Devices - /// that fail to initialize are ignored. Returns the offset the devices were - /// registere

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
@@ -92,10 +65,10 @@ struct PluginManager { std::make_unique(TgtBinDesc, TgtDeviceImage)); } - /// Initialize as many devices as possible for this plugin adaptor. Devices - /// that fail to initialize are ignored. Returns the offset the devices were - /// registere

[clang] [llvm] [Libomptarget] Statically link all plugin runtimes (PR #87009)

2024-05-01 Thread Johannes Doerfert via cfe-commits
@@ -34,38 +33,10 @@ #include #include -struct PluginManager; - -/// Plugin adaptors should be created via `PluginAdaptorTy::create` which will -/// invoke the constructor and call `PluginAdaptorTy::init`. Eventual errors are -/// reported back to the caller, otherwise a val

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-05-02 Thread Johannes Doerfert via cfe-commits
@@ -607,15 +621,17 @@ class OpenMPIRBuilder { /// Generator for '#omp barrier' /// /// \param Loc The location where the barrier directive was encountered. - /// \param DK The kind of directive that caused the barrier. + /// \param Kind The kind of directive that caused

[clang] [OpenMP][Doc] Add `ompx_bare` entry in `OpenMPSupport.rst` (PR #101711)

2024-08-02 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. https://github.com/llvm/llvm-project/pull/101711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-04 Thread Johannes Doerfert via cfe-commits
@@ -11357,8 +11358,13 @@ void OMPClauseReader::VisitOMPAllocateClause(OMPAllocateClause *C) { void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) { VisitOMPClauseWithPreInit(C); - C->setNumTeams(Record.readSubExpr()); C->setLParenLoc(Record.readSourceLoca

[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-04 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/99732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-04 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: I think this is almost ready. Only missing thing is the >3 argument check and test. https://github.com/llvm/llvm-project/pull/99732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-04 Thread Johannes Doerfert via cfe-commits
@@ -11639,6 +11639,7 @@ def warn_omp_unterminated_declare_target : Warning< InGroup; def err_ompx_bare_no_grid : Error< "'ompx_bare' clauses requires explicit grid size via 'num_teams' and 'thread_limit' clauses">; +def err_omp_multi_expr_not_allowed: Error<"only one expre

[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-04 Thread Johannes Doerfert via cfe-commits
@@ -13004,13 +13004,34 @@ StmtResult SemaOpenMP::ActOnOpenMPTargetUpdateDirective( Clauses, AStmt); } +// This checks whether num_teams clause only has one expression. +static bool checkNumTeamsClauseSingleExpr(SemaBase &SemaRef,

[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-05 Thread Johannes Doerfert via cfe-commits
@@ -11357,8 +11358,13 @@ void OMPClauseReader::VisitOMPAllocateClause(OMPAllocateClause *C) { void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) { VisitOMPClauseWithPreInit(C); - C->setNumTeams(Record.readSubExpr()); C->setLParenLoc(Record.readSourceLoca

[clang] [llvm] [OpenMP] OpenMP 5.1 "assume" directive parsing support (PR #92731)

2024-08-05 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: This broke the Flang build. You need to add some Flang code for all changes in omp.td. Look for a similar clause in the flang subproject to see what to do, and verify by building Flang. Maybe revert for now until fixed. https://github.com/llvm/llvm-project/pull/92731 _

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-06 Thread Johannes Doerfert via cfe-commits
@@ -5838,7 +5839,7 @@ QualType TreeTransform::TransformDependentAddressSpaceType( } else { TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo( Result, getDerived().getBaseLocation()); -TransformType(TLB, DI->getTypeLoc()); +TLB.TypeWasModifie

[clang] [Clang] Fix crash when transforming a `DependentAddressSpaceType` (PR #102206)

2024-08-07 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Thanks a lot! https://github.com/llvm/llvm-project/pull/102206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][PassBuilder] Extend the function signature of callback for optimizer pipeline extension point (PR #100953)

2024-08-07 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Split it, and maybe add the Phase to the rest as well. One commit to just make it consistent and pass the information along. Second for the AMDGPU stuff. > @jdoerfert Possibly the issue you saw is that this callback just isn't used > by the post-link full LTO pipeline at all?

[clang] 6f2ee1c - [OpenMP][AMDGPU] Optimize the linked in math libraries

2022-01-19 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2022-01-19T23:36:36-06:00 New Revision: 6f2ee1ca5e39b4286f7eb1aeb63b408f952f93c9 URL: https://github.com/llvm/llvm-project/commit/6f2ee1ca5e39b4286f7eb1aeb63b408f952f93c9 DIFF: https://github.com/llvm/llvm-project/commit/6f2ee1ca5e39b4286f7eb1aeb63b408f952f93c9.d

[clang] cbe8b57 - [Clang] Allow the combination of loader_uninitialized and address spaces

2021-04-23 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-04-23T11:21:52-05:00 New Revision: cbe8b57a675537183eaf8c32eaa6087cea3fc5da URL: https://github.com/llvm/llvm-project/commit/cbe8b57a675537183eaf8c32eaa6087cea3fc5da DIFF: https://github.com/llvm/llvm-project/commit/cbe8b57a675537183eaf8c32eaa6087cea3fc5da.d

[clang] 5d8d994 - [OpenMP] Make sure classes work on the device as they do on the host

2021-05-06 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-05-06T02:10:30-05:00 New Revision: 5d8d994dfbe38fe86b1d883daa9fd8e47cdc1376 URL: https://github.com/llvm/llvm-project/commit/5d8d994dfbe38fe86b1d883daa9fd8e47cdc1376 DIFF: https://github.com/llvm/llvm-project/commit/5d8d994dfbe38fe86b1d883daa9fd8e47cdc1376.d

[clang] 3f14596 - [OpenMP] Ensure the DefaultMapperId has a location

2021-05-06 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-05-06T02:10:36-05:00 New Revision: 3f14596700093bce436ae27178c307e842398b65 URL: https://github.com/llvm/llvm-project/commit/3f14596700093bce436ae27178c307e842398b65 DIFF: https://github.com/llvm/llvm-project/commit/3f14596700093bce436ae27178c307e842398b65.d

[clang] 37639b7 - [OpenMP][FIX] Emit debug declares only if debug info is available

2022-01-08 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2022-01-08T17:01:19-06:00 New Revision: 37639b72a17be443e7f73e906554f8bbd0dbf271 URL: https://github.com/llvm/llvm-project/commit/37639b72a17be443e7f73e906554f8bbd0dbf271 DIFF: https://github.com/llvm/llvm-project/commit/37639b72a17be443e7f73e906554f8bbd0dbf271.d

[clang] 7f1eaea - [OpenMP][NFC] Extract assumption helpers into own header file

2021-12-28 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-12-28T23:53:29-06:00 New Revision: 7f1eaeafe7a13fc642e9510f43ec19390b32157d URL: https://github.com/llvm/llvm-project/commit/7f1eaeafe7a13fc642e9510f43ec19390b32157d DIFF: https://github.com/llvm/llvm-project/commit/7f1eaeafe7a13fc642e9510f43ec19390b32157d.d

[clang] 03cc8a1 - [OpenMP][NFC] Move the `noinline` to the parallel entry point

2021-03-29 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-03-30T01:12:45-05:00 New Revision: 03cc8a1ba050f3138c30e7771e29a32fab22e957 URL: https://github.com/llvm/llvm-project/commit/03cc8a1ba050f3138c30e7771e29a32fab22e957 DIFF: https://github.com/llvm/llvm-project/commit/03cc8a1ba050f3138c30e7771e29a32fab22e957.d

[clang] d970a28 - [OpenMP][Fix] Make the arch selector for x86_64 work

2021-01-07 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-01-07T14:31:18-06:00 New Revision: d970a285b8567b93aea39e7e4d10965fe8b7340c URL: https://github.com/llvm/llvm-project/commit/d970a285b8567b93aea39e7e4d10965fe8b7340c DIFF: https://github.com/llvm/llvm-project/commit/d970a285b8567b93aea39e7e4d10965fe8b7340c.d

[clang] 36c4dc9 - [OpenMP][FIX] Ensure the isa trait is evaluated last

2021-01-07 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-01-07T14:31:20-06:00 New Revision: 36c4dc9b42fe2e6af4ab488b7c4013d5082b67f6 URL: https://github.com/llvm/llvm-project/commit/36c4dc9b42fe2e6af4ab488b7c4013d5082b67f6 DIFF: https://github.com/llvm/llvm-project/commit/36c4dc9b42fe2e6af4ab488b7c4013d5082b67f6.d

[clang] 6e71015 - [OpenMP][Docs] Mark finished features as done

2021-01-07 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-01-07T14:39:18-06:00 New Revision: 6e7101530dae78efd7b5cdffc1338790ed3e5705 URL: https://github.com/llvm/llvm-project/commit/6e7101530dae78efd7b5cdffc1338790ed3e5705 DIFF: https://github.com/llvm/llvm-project/commit/6e7101530dae78efd7b5cdffc1338790ed3e5705.d

[clang] 2930c83 - [OpenMP][FIX] Allow declare variant to work with reference types

2021-08-27 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-08-27T13:12:14-05:00 New Revision: 2930c839a5877356db6966409f4f9f2cdbcf3a07 URL: https://github.com/llvm/llvm-project/commit/2930c839a5877356db6966409f4f9f2cdbcf3a07 DIFF: https://github.com/llvm/llvm-project/commit/2930c839a5877356db6966409f4f9f2cdbcf3a07.d

[clang] 45e8e08 - [OpenMP] Encode `omp [...] assume[...]` assumptions with `omp[x]` prefix

2021-09-10 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2021-09-10T12:08:52-05:00 New Revision: 45e8e084921b99ca36131d7f90359c70c4e1a25c URL: https://github.com/llvm/llvm-project/commit/45e8e084921b99ca36131d7f90359c70c4e1a25c DIFF: https://github.com/llvm/llvm-project/commit/45e8e084921b99ca36131d7f90359c70c4e1a25c.d

[clang] [llvm] [OpenMP] Map `omp_default_mem_alloc` to global memory (PR #104790)

2024-08-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG https://github.com/llvm/llvm-project/pull/104790 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-21 Thread Johannes Doerfert via cfe-commits
@@ -393,22 +393,17 @@ struct CUDADeviceTy : public GenericDeviceTy { return Plugin::success(); } - virtual Error callGlobalConstructors(GenericPluginTy &Plugin, - DeviceImageTy &Image) override { -// Check for the presense of gl

[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

2024-06-26 Thread Johannes Doerfert via cfe-commits
@@ -1274,4 +1277,97 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File, return 0; } +int __llvm_write_custom_profile(const char *Target, +const __llvm_profile_data *DataBegin, +const __llvm

[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

2024-06-26 Thread Johannes Doerfert via cfe-commits
@@ -296,6 +296,17 @@ int __llvm_profile_get_padding_sizes_for_counters( */ void __llvm_profile_set_dumped(); +/*! + * \brief Write custom target-specific profiling data to a seperate file. + * Used by libomptarget for GPU PGO. jdoerfert wrote: ```suggestion

[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

2024-06-26 Thread Johannes Doerfert via cfe-commits
@@ -829,6 +829,25 @@ Error GenericDeviceTy::deinit(GenericPluginTy &Plugin) { DeviceMemoryPoolTracking.AllocationMax); } + for (auto *Image : LoadedImages) { +GenericGlobalHandlerTy &Handler = Plugin.getGlobalHandler(); +if (!Handler.hasProfilingGlobals(*

[clang] [compiler-rt] [llvm] [openmp] [PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (PR #93365)

2024-06-26 Thread Johannes Doerfert via cfe-commits
@@ -829,6 +829,25 @@ Error GenericDeviceTy::deinit(GenericPluginTy &Plugin) { DeviceMemoryPoolTracking.AllocationMax); } + for (auto *Image : LoadedImages) { +GenericGlobalHandlerTy &Handler = Plugin.getGlobalHandler(); +if (!Handler.hasProfilingGlobals(*

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -444,32 +444,81 @@ template struct omptarget_nvptx_LoopSupport { // KMP interface implementation (dyn loops) -// TODO: This is a stopgap. We probably want to expand the dispatch API to take

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,57 @@ +// clang-format off +// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic 2>&1 | %fcheck-generic +// clang-format on + +// UNSUPPORTED: aarch64-unknown-linux-gnu +// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO +// UNSUPPORTED: x86_64-pc-linux-gnu

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -444,32 +444,81 @@ template struct omptarget_nvptx_LoopSupport { // KMP interface implementation (dyn loops) -// TODO: This is a stopgap. We probably want to expand the dispatch API to take

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -3044,6 +3046,9 @@ void CodeGenFunction::EmitOMPForOuterLoop( OuterLoopArgs.DKind = LoopArgs.DKind; EmitOMPOuterLoop(DynamicOrOrdered, IsMonotonic, S, LoopScope, OuterLoopArgs, emitOMPLoopBodyWithStopPoint, CodeGenOrdered); + if (DynamicOrOrdered) { -

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,84 @@ +// clang-format off +// RUN: %libomptarget-compile-generic && %libomptarget-run-generic 2>&1 | %fcheck-generic +// clang-format on + +// UNSUPPORTED: aarch64-unknown-linux-gnu +// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO +// UNSUPPORTED: x86_64-pc-linux-gnu +/

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -444,32 +444,81 @@ template struct omptarget_nvptx_LoopSupport { // KMP interface implementation (dyn loops) -// TODO: This is a stopgap. We probably want to expand the dispatch API to take

[clang] [Clang] Introduce 'clang-nvlink-wrapper' to work around 'nvlink' (PR #96561)

2024-06-28 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/96561 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -444,28 +445,77 @@ template struct omptarget_nvptx_LoopSupport { // KMP interface implementation (dyn loops) -// TODO: This is a stopgap. We probably want to expand the dispatch API to take

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -444,28 +445,77 @@ template struct omptarget_nvptx_LoopSupport { // KMP interface implementation (dyn loops) -// TODO: This is a stopgap. We probably want to expand the dispatch API to take

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
@@ -444,28 +445,77 @@ template struct omptarget_nvptx_LoopSupport { // KMP interface implementation (dyn loops) -// TODO: This is a stopgap. We probably want to expand the dispatch API to take

[clang] [llvm] [openmp] [OpenMP][offload] Fix dynamic schedule tracking (PR #97065)

2024-06-28 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, @shiltian, OK? https://github.com/llvm/llvm-project/pull/97065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert edited https://github.com/llvm/llvm-project/pull/110179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: I left many minor comments but nothing blocking. @jhuber6 Were there any conceptual concerns in the thread? https://github.com/llvm/llvm-project/pull/110179 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,86 @@ +//===-- gpuintrin.h - Generic GPU intrinsic functions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,86 @@ +//===-- gpuintrin.h - Generic GPU intrinsic functions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,154 @@ +//===-- nvptxintrin.h - NVPTX intrinsic functions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,86 @@ +//===-- gpuintrin.h - Generic GPU intrinsic functions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,184 @@ +//===-- nvptxintrin.h - NVPTX intrinsic functions -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [libc] [Clang] Implement resource directory headers for common GPU intrinsics (PR #110179)

2024-11-05 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,154 @@ +//===-- amdgpuintrin.h - AMDPGU intrinsic functions ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

<    1   2   3   4   5   >