[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

[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

[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 - ///

[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 - ///

[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

[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
@@ -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

[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] [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:

[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:

[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:

[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:

[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:

[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:

[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
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] [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 , /*IsCancellable*/ true); } -/// Create a function with a unique name and a "void (i8*, i8*)" signature in -/// the given module and return it. -Function

[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

[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
@@ -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?

[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

[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] [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] [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] [Clang][NFC] Clean up unused binary files for offloading tests (PR #87351)

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

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-04-01 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: FWIW, for OpenMP we only need to support the [[]] spelling in C++. The fact we had everything else was a side-effect of the implementation, IIRC. Thus, this should be fine for OpenMP. https://github.com/llvm/llvm-project/pull/84934

[clang] [OpenMP] Use loaded offloading toolchains to add libraries (PR #87108)

2024-04-01 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. https://github.com/llvm/llvm-project/pull/87108 ___ 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-03-26 Thread Johannes Doerfert via cfe-commits
@@ -1235,27 +1251,56 @@ class OpenMPIRBuilder { getTargetEntryUniqueInfo(FileIdentifierInfoCallbackTy CallBack, StringRef ParentName = ""); - /// Functions used to generate reductions. Such functions take two Values - /// representing LHS and

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

2024-03-26 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

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

2024-03-26 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Some comments inlined. Do we support non trivial constructors for reduction variables? Similarly, did we support user defined reductions? If either questions is answered with yes, do we keep that support? We might need to ask Alexey.

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

2024-03-26 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,1071 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]"

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

2024-03-26 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-03-26 Thread Johannes Doerfert via cfe-commits
@@ -1235,27 +1251,56 @@ class OpenMPIRBuilder { getTargetEntryUniqueInfo(FileIdentifierInfoCallbackTy CallBack, StringRef ParentName = ""); - /// Functions used to generate reductions. Such functions take two Values - /// representing LHS and

[clang] [llvm] [openmp] [OpenMP] Increment kernel args version, used by runtime for detecting dyn_ptr. (PR #85363)

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

[clang] [llvm] [openmp] [OpenMP] Increment kernel args version, used by runtime for detecting dyn_ptr. (PR #85363)

2024-03-15 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: > The versioning is required to support use cases where code generated by an > older compiler is linked with a newer runtime. Is that supported? https://github.com/llvm/llvm-project/pull/85363 ___ cfe-commits mailing list

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-26 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -o - | FileCheck %s + +void t1() __attribute__((llvm_fn_attr("custom_attr", "custom_value"), llvm_fn_attr("second_attr", "second_value"))); + +void t1() +{ +} + +void t2(); + +void t3() { + t2()

[clang] [llvm] [openmp] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-02-16 Thread Johannes Doerfert via cfe-commits
@@ -2067,6 +2067,10 @@ Constant *ConstantExpr::getBitCast(Constant *C, Type *DstTy, Constant *ConstantExpr::getAddrSpaceCast(Constant *C, Type *DstTy, bool OnlyIfReduced) { + // Skip cast if types are identical

[clang] [llvm] [transforms] Inline simple variadic functions (PR #81058)

2024-02-13 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: High level question: Does this patch eliminate the variadic call edge, or, does it perform inlining on very special variadic function definitions? I thought the former but `isFunctionInlinable`, sufficiently confused me. https://github.com/llvm/llvm-project/pull/81058

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

2024-02-09 Thread Johannes Doerfert via cfe-commits
@@ -36,14 +36,14 @@ void test() { // CHECK1-NEXT:[[DYN_PTR_ADDR:%.*]] = alloca ptr, align 8 // CHECK1-NEXT:[[DOTZERO_ADDR:%.*]] = alloca i32, align 4 // CHECK1-NEXT:[[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 -// CHECK1-NEXT:store ptr [[DYN_PTR]], ptr

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

2024-02-09 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: So, just to double check. On the Clang side, all you did is move the codegen and adapt it to work in the OMPIRBuilder, right? Expected outcome is the same, modulo the two small changes. https://github.com/llvm/llvm-project/pull/80343

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

2024-02-09 Thread Johannes Doerfert via cfe-commits
@@ -2953,7 +2953,7 @@ int bar(int n){ // CHECK3-NEXT:[[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]] // CHECK3-NEXT:[[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32

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

2024-02-09 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

[llvm] [clang] [Offload] Fix the offloading wrapper when merged multiple times. (PR #79231)

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

[clang] [LinkerWrapper] Do not link device code under a relocatable link (PR #79314)

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

[llvm] [clang] [Offload] Fix the offloading wrapper when merged multiple times. (PR #79231)

2024-01-24 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Do we need two different linkages or could the COFF setting be used in both? Can we have a test to show the merging works as expected? https://github.com/llvm/llvm-project/pull/79231 ___ cfe-commits mailing list

[clang] [LinkerWrapper] Do not link device code under a relocatable link (PR #79314)

2024-01-24 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Test? https://github.com/llvm/llvm-project/pull/79314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #75647)

2024-01-16 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: We are back to the duplication. The attribute here, num-work-groups, exist in IR as: NVPTX: minctasm -> min work groups NVPTX: maxclusterrank -> max work groups OpenMP: omp_target_num_teams -> right now exact = num work groups @bader This is not the same as the intrinsics but

[clang] [OpenMP][USM] Adds test for -fopenmp-force-usm flag (PR #75467)

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

[llvm] [flang] [libc] [lld] [openmp] [lldb] [clang-tools-extra] [compiler-rt] [libcxx] [clang] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-01-09 Thread Johannes Doerfert via cfe-commits
@@ -959,8 +959,12 @@ void CodeGenPGO::emitCounterIncrement(CGBuilderTy , const Stmt *S, unsigned Counter = (*RegionCounterMap)[S]; - llvm::Value *Args[] = {FuncNameVar, - Builder.getInt64(FunctionHash), + // Make sure that pointer to global is

[libcxx] [llvm] [compiler-rt] [clang] [lldb] [flang] [clang-tools-extra] [openmp] [OpenMP] Add memory diff dump for kernel record-replay (PR #70667)

2024-01-05 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Can you rebase this so we can merge it? https://github.com/llvm/llvm-project/pull/70667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [libc] [flang] [openmp] [libcxx] [compiler-rt] [llvm] [clang-tools-extra] [clang] [lld] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-01-05 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: > > ongoing effort to extends PGO instrumentation to GPU device code > > Is there a high level description for this effort and its goal? Traditional > compiler PGO is mostly for profiling control-flow, but we don't usually have > a lot of control flow for GPU kernels. I am

[clang] [OpenMP] Change `__tgt_device_image` to point to the image (PR #77003)

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

[lldb] [clang] [llvm] [mlir] [libc] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-05 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. I left one more comment. I think the new classes are clearly superior to the pairs. I looked over the changes, nothing jumps out. LG https://github.com/llvm/llvm-project/pull/76882 ___

[lldb] [libc] [llvm] [mlir] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-05 Thread Johannes Doerfert via cfe-commits
@@ -187,80 +187,132 @@ Value *lowerObjectSizeCall( const TargetLibraryInfo *TLI, AAResults *AA, bool MustSucceed, SmallVectorImpl *InsertedInstructions = nullptr); -using SizeOffsetType = std::pair; +/// SizeOffsetType - A base template class for the object size

[clang] [lldb] [llvm] [libc] [mlir] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

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

[clang] [OpenMP][USM] Adds test for -fopenmp-force-usm flag (PR #75467)

2024-01-04 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: I see. FWIW "pGI_decl_tgt_ref_ptr" is really not a good name (not your fault). https://github.com/llvm/llvm-project/pull/75467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenMP][USM] Adds test for -fopenmp-force-usm flag (PR #75467)

2024-01-03 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: I mean, the test shows device IR for two functions, doesn't it? I am not aware that part is impacted by USM. Host globals/register functions are. https://github.com/llvm/llvm-project/pull/75467 ___ cfe-commits mailing list

[clang] [OpenMP][USM] Adds test for -fopenmp-force-usm flag (PR #75467)

2024-01-03 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: How do the IR checks verify the flag works? https://github.com/llvm/llvm-project/pull/75467 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [llvm] [lld] [libc] [compiler-rt] [openmp] [lldb] [flang] [clang-tools-extra] [clang] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-01-03 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Can we have tests for this? You can just check for the dump. https://github.com/llvm/llvm-project/pull/76587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[openmp] [clang-tools-extra] [flang] [libcxx] [libc] [compiler-rt] [clang] [lldb] [lld] [llvm] [PGO][OpenMP] Instrumentation for GPU devices (PR #76587)

2024-01-03 Thread Johannes Doerfert via cfe-commits
@@ -428,13 +428,22 @@ std::string getPGOFuncNameVarName(StringRef FuncName, return VarName; } +bool isGPUProfTarget(const Module ) { + const auto = M.getTargetTriple(); + return triple.rfind("nvptx", 0) == 0 || triple.rfind("amdgcn", 0) == 0 || +

[libc] [clang] [lldb] [llvm] [mlir] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-03 Thread Johannes Doerfert via cfe-commits
@@ -187,80 +187,147 @@ Value *lowerObjectSizeCall( const TargetLibraryInfo *TLI, AAResults *AA, bool MustSucceed, SmallVectorImpl *InsertedInstructions = nullptr); -using SizeOffsetType = std::pair; +/// SizeOffsetType - A base template class for the object size

[mlir] [libc] [clang] [lldb] [llvm] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

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

[llvm] [libc] [lldb] [mlir] [clang] [NFC][ObjectSizeOffset] Use classes instead of std::pair (PR #76882)

2024-01-03 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Generally, getting rid of the pair is great. I am unsure I understand why we do the base template rather than inheritance. Where is the base template used? If we do inheritance we could avoid duplicating of members and provide default impls that work

[clang] [OpenMP][USM] Introduces -fopenmp-force-usm flag (PR #76571)

2024-01-03 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Documentation missing as well. https://github.com/llvm/llvm-project/pull/76571 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [openmp] [Clang][OpenMP] Fix mapping of structs to device (PR #75642)

2023-12-21 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: This fails for me on the host and the AMD GPU: GPU: # | :217:1: note: possible intended match here # | dat.datum[dat.arr[0][0]] = 5 X86: # | :134:1: note: possible intended match here # | dat.datum[dat.arr[0][0]] = 5461 The location that is printed (datum[1]) is uninitialized.

[lldb] [libc] [llvm] [compiler-rt] [clang] [flang] [libcxx] [clang-tools-extra] [openmp] [lld] [mlir] [libunwind] [OpenMP] Improve omp offload profiler (PR #68016)

2023-12-21 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG. Please rebase and merge. https://github.com/llvm/llvm-project/pull/68016 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [openmp] [clang] [OpenMP] Add extra flags to libomptarget and plugin builds (PR #74520)

2023-12-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert closed https://github.com/llvm/llvm-project/pull/74520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [openmp] [clang] [OpenMP] Add extra flags to libomptarget and plugin builds (PR #74520)

2023-12-11 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/74520 >From f505868953d07125f67bcbb79be426a6deee1a13 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Tue, 5 Dec 2023 12:35:04 -0800 Subject: [PATCH 1/2] [OpenMP] Add extra flags to libomptarget and plugin

[clang-tools-extra] [llvm] [clang-tidy] Add bugprone-move-shared-pointer-contents check. (PR #67467)

2023-12-01 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/67467 >From 6d5d35e1273f595e8a0382053d5183cbce7a9d8a Mon Sep 17 00:00:00 2001 From: David Pizzuto Date: Tue, 26 Sep 2023 10:45:42 -0700 Subject: [PATCH] [clang-tidy] Add bugprone-move-shared-pointer-contents check.

[openmp] [clang] [OpenMP] Avoid initializing the KernelLaunchEnvironment if possible (PR #73864)

2023-11-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert closed https://github.com/llvm/llvm-project/pull/73864 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [libcxx] [clang] [openmp] [flang] [OpenMP][NFC] Separate OpenMP/OpenACC specific mapping code (PR #73817)

2023-11-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert closed https://github.com/llvm/llvm-project/pull/73817 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [libcxx] [clang] [openmp] [flang] [OpenMP][NFC] Separate OpenMP/OpenACC specific mapping code (PR #73817)

2023-11-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/73817 >From ed1513641d575c4a2881613864c892aff7855a78 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Tue, 28 Nov 2023 18:51:23 -0800 Subject: [PATCH] [OpenMP][NFC] Separate OpenMP/OpenACC specific mapping

[clang] [openmp] [OpenMP] Directly use user's grid and block size in kernel language mode (PR #70612)

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

[clang] [openmp] [OpenMP] Directly use user's grid and block size in kernel language mode (PR #70612)

2023-11-28 Thread Johannes Doerfert via cfe-commits
@@ -14633,6 +14633,26 @@ StmtResult Sema::ActOnOpenMPTargetTeamsDirective(ArrayRef Clauses, } setFunctionHasBranchProtectedScope(); + bool HasBareClause = false; + bool HasThreadLimitClause = false; + bool HasNumTeamsClause = false; + OMPClause *BareClause = nullptr;

[openmp] [clang] [OpenMP] Directly use user's grid and block size in kernel language mode (PR #70612)

2023-11-28 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, see the nit. Also, add a runtime test with bare and verify we stick with values we otherwise would not, e.g., 1 teams and 1024 threads. https://github.com/llvm/llvm-project/pull/70612

[clang] [Clang] CWG2789 Overload resolution with implicit and explicit object… (PR #73493)

2023-11-27 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/73493 >From 3758290904571237c13ba23f2e3f65e58b6598aa Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 27 Nov 2023 10:48:13 +0100 Subject: [PATCH 1/2] [Clang] CWG2789 Overload resolution with implicit and

[clang] [llvm] [clang] report inlining decisions with -Wattribute-{warning|error} (PR #73552)

2023-11-27 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/73552 >From cea177222b421c67dabbe9e267f8b9a4ead4d51e Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Tue, 10 Jan 2023 17:42:18 -0800 Subject: [PATCH 01/15] [clang] report inlining decisions with

[clang] [openmp] [Clang][OpenMP] Fix ordering of processing of map clauses when mapping a struct. (PR #72410)

2023-11-20 Thread Johannes Doerfert via cfe-commits
@@ -7742,15 +7744,42 @@ class MappableExprsHandler { else if (C->getMapType() == OMPC_MAP_alloc) Kind = Allocs; const auto *EI = C->getVarRefs().begin(); - for (const auto L : C->component_lists()) { -const Expr *E = (C->getMapLoc().isValid())

[clang] [llvm] [Offload] Initial support for registering offloading entries on COFF targets (PR #72697)

2023-11-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, two nits. https://github.com/llvm/llvm-project/pull/72697 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Offload] Initial support for registering offloading entries on COFF targets (PR #72697)

2023-11-20 Thread Johannes Doerfert via cfe-commits
@@ -62,35 +63,51 @@ void offloading::emitOffloadingEntry(Module , Constant *Addr, StringRef Name, M.getDataLayout().getDefaultGlobalsAddressSpace()); // The entry has to be created in the section the linker expects it to be. - Entry->setSection(SectionName); + if

[llvm] [clang] [Offload] Initial support for registering offloading entries on COFF targets (PR #72697)

2023-11-20 Thread Johannes Doerfert via cfe-commits
@@ -62,35 +63,51 @@ void offloading::emitOffloadingEntry(Module , Constant *Addr, StringRef Name, M.getDataLayout().getDefaultGlobalsAddressSpace()); // The entry has to be created in the section the linker expects it to be. - Entry->setSection(SectionName); + if

[llvm] [clang] [Offload] Initial support for registering offloading entries on COFF targets (PR #72697)

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

[clang] 7318fe6 - [OpenMP][FIX] Ensure device reduction geps work for multi-var reductions

2023-11-10 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-11-10T14:34:46-08:00 New Revision: 7318fe633487f9b9187e18c7ebd4c6516ded9a22 URL: https://github.com/llvm/llvm-project/commit/7318fe633487f9b9187e18c7ebd4c6516ded9a22 DIFF:

[llvm] [clang] [openmp] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -1038,6 +1048,109 @@ struct CUDADeviceTy : public GenericDeviceTy { using CUDAStreamManagerTy = GenericDeviceResourceManagerTy; using CUDAEventManagerTy = GenericDeviceResourceManagerTy; + Error callGlobalCtorDtorCommon(GenericPluginTy , DeviceImageTy , +

[llvm] [openmp] [clang] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -1038,6 +1048,100 @@ struct CUDADeviceTy : public GenericDeviceTy { using CUDAStreamManagerTy = GenericDeviceResourceManagerTy; using CUDAEventManagerTy = GenericDeviceResourceManagerTy; + Error callGlobalCtorDtorCommon(GenericPluginTy , DeviceImageTy , +

[openmp] [llvm] [clang] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %libomptarget-compilexx-run-and-check-generic + +// REQUIRES: libc + +#include + +#pragma omp begin declare target device_type(nohost) + +// CHECK: void ctor1() +// CHECK: void ctor2() +// CHECK: void ctor3() +[[gnu::constructor(101)]] void ctor1() {

[clang] [openmp] [llvm] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -2627,6 +2637,38 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy { using AMDGPUEventRef = AMDGPUResourceRef; using AMDGPUEventManagerTy = GenericDeviceResourceManagerTy; + /// Common method to invoke a single threaded constructor or destructor +

[clang] [llvm] [openmp] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, check my comments. https://github.com/llvm/llvm-project/pull/71739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [openmp] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

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

[llvm] [clang] [openmp] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -1038,6 +1048,109 @@ struct CUDADeviceTy : public GenericDeviceTy { using CUDAStreamManagerTy = GenericDeviceResourceManagerTy; using CUDAEventManagerTy = GenericDeviceResourceManagerTy; + Error callGlobalCtorDtorCommon(GenericPluginTy , DeviceImageTy , +

[openmp] [clang] [llvm] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -313,12 +313,18 @@ static void registerGlobalCtorsDtorsForImage(__tgt_bin_desc *Desc, DP("Adding ctor " DPxMOD " to the pending list.\n", DPxPTR(Entry->addr)); Device.PendingCtorsDtors[Desc].PendingCtors.push_back(Entry->addr); +

[llvm] [clang] [openmp] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -1038,6 +1048,109 @@ struct CUDADeviceTy : public GenericDeviceTy { using CUDAStreamManagerTy = GenericDeviceResourceManagerTy; using CUDAEventManagerTy = GenericDeviceResourceManagerTy; + Error callGlobalCtorDtorCommon(GenericPluginTy , DeviceImageTy , +

[openmp] [llvm] [clang] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -1038,6 +1048,109 @@ struct CUDADeviceTy : public GenericDeviceTy { using CUDAStreamManagerTy = GenericDeviceResourceManagerTy; using CUDAEventManagerTy = GenericDeviceResourceManagerTy; + Error callGlobalCtorDtorCommon(GenericPluginTy , DeviceImageTy , +

[llvm] [openmp] [clang] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -1038,6 +1048,109 @@ struct CUDADeviceTy : public GenericDeviceTy { using CUDAStreamManagerTy = GenericDeviceResourceManagerTy; using CUDAEventManagerTy = GenericDeviceResourceManagerTy; + Error callGlobalCtorDtorCommon(GenericPluginTy , DeviceImageTy , +

[clang] [llvm] [openmp] [OpenMP] Rework handling of global ctor/dtors in OpenMP (PR #71739)

2023-11-10 Thread Johannes Doerfert via cfe-commits
@@ -2627,6 +2637,48 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy { using AMDGPUEventRef = AMDGPUResourceRef; using AMDGPUEventManagerTy = GenericDeviceResourceManagerTy; + /// Common method to invoke a single threaded constructor or destructor +

[clang] 921bd29 - [OpenMP] Remove alignment for global <-> local reduction functions

2023-11-06 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-11-06T11:50:41-08:00 New Revision: 921bd299134fbe17c676b2486af269e18281def4 URL: https://github.com/llvm/llvm-project/commit/921bd299134fbe17c676b2486af269e18281def4 DIFF:

[clang] abe71b7 - [OpenMP][NFC] Delete dead code

2023-11-06 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-11-06T11:50:41-08:00 New Revision: abe71b77f9ac2fc689e899fa6aa2486120c53912 URL: https://github.com/llvm/llvm-project/commit/abe71b77f9ac2fc689e899fa6aa2486120c53912 DIFF:

[clang] [llvm] Recommit changes to global checks (PR #71171)

2023-11-03 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: > > I think if the issues with the original commit are resolved, this is good > > to go. > > Did you verify we can properly auto-generate files, e.g., in > > llvm/test/Transforms/Attributor and clang/test/OpenMP? > > Ah no I did not, I'll do that on Monday. I'd run

[clang] d3e7a48 - [OpenMP][NFC] Remove a no-op function

2023-11-03 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-11-03T10:28:36-07:00 New Revision: d3e7a48cbde060a6dbc1edcb00f375fb2f9405dc URL: https://github.com/llvm/llvm-project/commit/d3e7a48cbde060a6dbc1edcb00f375fb2f9405dc DIFF:

[llvm] [clang] Recommit changes to global checks (PR #71171)

2023-11-03 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: I think if the issues with the original commit are resolved, this is good to go. Did you verify we can properly auto-generate files, e.g., in llvm/test/Transforms/Attributor and clang/test/OpenMP? https://github.com/llvm/llvm-project/pull/71171

  1   2   3   4   >