[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

[clang] [llvm] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-11-02 Thread Johannes Doerfert via cfe-commits
@@ -1026,25 +1026,25 @@ for (int i = 0; i < argc; ++i) { // CHECK3-NEXT:call void @llvm.experimental.noalias.scope.decl(metadata [[META8:![0-9]+]]) // CHECK3-NEXT:call void @llvm.experimental.noalias.scope.decl(metadata [[META10:![0-9]+]]) // CHECK3-NEXT:call

[llvm] [clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-11-02 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, commit the two commits separately though https://github.com/llvm/llvm-project/pull/67000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

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

[clang] [OpenMP] Make team reductions less bad (PR #70981)

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

[clang] 0e06ddf - Revert "[APINotes] Upstream APINotesOptions"

2023-11-01 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-11-01T11:33:25-07:00 New Revision: 0e06ddf0f6896cfd817a1b97a43b78331e0b1d66 URL: https://github.com/llvm/llvm-project/commit/0e06ddf0f6896cfd817a1b97a43b78331e0b1d66 DIFF:

[openmp] [clang] [OpenMP][FIX] Allocate per launch memory for GPU team reductions (PR #70752)

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

[openmp] [clang] [OpenMP][FIX] Allocate per launch memory for GPU team reductions (PR #70752)

2023-11-01 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/70752 >From 1859bd43bc2c0bb32fc028f0daf73525f039c5d2 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 30 Oct 2023 16:39:00 -0700 Subject: [PATCH] [OpenMP][FIX] Allocate per launch memory for GPU team

[openmp] [clang] [OpenMP][FIX] Allocate per launch memory for GPU team reductions (PR #70752)

2023-11-01 Thread Johannes Doerfert via cfe-commits
@@ -194,6 +191,9 @@ int32_t __kmpc_nvptx_teams_reduce_nowait_v2( ThreadId = 0; } + uint32_t = state::getKernelLaunchEnvironment().ReductionIterCnt; + uint32_t = state::getKernelLaunchEnvironment().ReductionCnt; jdoerfert wrote: They are, I replaced

[openmp] [clang] [OpenMP] Team reduction work specialization (PR #70766)

2023-10-31 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/70766 >From 04aafdce6f259e31304ed47118a56042b155bd77 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 30 Oct 2023 16:39:00 -0700 Subject: [PATCH 1/2] [OpenMP][FIX] Allocate per launch memory for GPU team

[clang] [openmp] [OpenMP][FIX] Allocate per launch memory for GPU team reductions (PR #70752)

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

[openmp] [clang] [OpenMP][FIX] Allocate per launch memory for GPU team reductions (PR #70752)

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

[clang] [openmp] [OpenMP][FIX] Allocate per launch memory for GPU team reductions (PR #70752)

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

[clang] [openmp] [OpenMP] Non racy team reductions (PR #70752)

2023-10-31 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/70752 >From 04aafdce6f259e31304ed47118a56042b155bd77 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 30 Oct 2023 16:39:00 -0700 Subject: [PATCH] [OpenMP][FIX] Allocate per launch memory for GPU team

[openmp] [llvm] [mlir] [clang] [OpenMP] Introduce the KernelLaunchEnvironment as implicit argument (PR #70401)

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

[openmp] [llvm] [mlir] [clang] [OpenMP] Introduce the KernelLaunchEnvironment as implicit argument (PR #70401)

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

[clang] [OpenMP] Associate the KernelEnvironment with the GenericKernelTy (PR #70383)

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

[clang] [OpenMP] Associate the KernelEnvironment with the GenericKernelTy (PR #70383)

2023-10-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/70383 >From fa6d6d9cf6398915f911e06eecc78c7ba83d3623 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 25 Oct 2023 16:46:01 -0700 Subject: [PATCH] [OpenMP] Associate the KernelEnvironment with the

[clang] [OpenMP] Unify the min/max thread/teams pathways (PR #70273)

2023-10-28 Thread Johannes Doerfert via cfe-commits
@@ -1,68 +1,20 @@ -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s -check-prefix=CHECK1 -// RUN: %clang_cc1 -fopenmp

[clang] [clang] Robustify openmp test (PR #69739)

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

[clang] [CodeGen][OpenMP] Set the default schedule for loops to static,1 if TSan is enabled (PR #68891)

2023-10-27 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,161 @@ +/* + * DRB006-indirectaccess2-orig-yes.c -- Archer testcase + */ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// +// See

[clang] [OpenMP] Unify the min/max thread/teams pathways (PR #70273)

2023-10-27 Thread Johannes Doerfert via cfe-commits
@@ -1,68 +1,20 @@ -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s -check-prefix=CHECK1 -// RUN: %clang_cc1 -fopenmp

[clang] [OpenMP] Pass min/max thread and team count to the OMPIRBuilder (PR #70247)

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

[clang] [OpenMP] Pass min/max thread and team count to the OMPIRBuilder (PR #70247)

2023-10-26 Thread Johannes Doerfert via cfe-commits
@@ -607,8 +608,13 @@ void CodeGenModule::handleAMDGPUFlatWorkGroupSizeAttr( if (Min != 0) { assert(Min <= Max && "Min must be less than or equal Max"); +if (MinThreadsVal) + *MinThreadsVal = Min; +if (MaxThreadsVal) + *MaxThreadsVal = Max;

[clang] 57cebc7 - [OpenMP][NFC] Fix test (remove wrong autogen header)

2023-10-26 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-10-26T14:38:24-07:00 New Revision: 57cebc709df0ce839807b852432eccf345d8a63e URL: https://github.com/llvm/llvm-project/commit/57cebc709df0ce839807b852432eccf345d8a63e DIFF:

[clang] ab34d71 - [OpenMP][NFC] Remove untested code emitting no-op call

2023-10-26 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-10-26T14:38:24-07:00 New Revision: ab34d71087a85a9d024657207683ea0eb775d326 URL: https://github.com/llvm/llvm-project/commit/ab34d71087a85a9d024657207683ea0eb775d326 DIFF:

[clang] [OpenMP] Unify the min/max thread/teams pathways (PR #70273)

2023-10-25 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: This contains two other commits that are in two other PRs and will be committed first. https://github.com/llvm/llvm-project/pull/70273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Robustify openmp test (PR #69739)

2023-10-25 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Your motivation is sound, apologies for the churn this caused. Thaat said, this alias is not `noalias` but global symbols aliases. The commit that introduced the NOT check removed: ``` // CHECK-DAG: @_ZN16SpecSpecialFuncs6MethodEv = {{.*}}alias i32

[clang] [PassBuilder] Add a mechanism for adding passbuilder callbacks for static builds (PR #70171)

2023-10-25 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Can you make an example on how this is used now? Is there a way to test this? https://github.com/llvm/llvm-project/pull/70171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -1736,26 +1750,20 @@ OpenMPIRBuilder::createTask(const LocationDescription , StaleCI->eraseFromParent(); -// Emit the body for wrapper function -BasicBlock *WrapperEntryBB = -BasicBlock::Create(M.getContext(), "", WrapperFunc); -

[libunwind] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -5771,84 +5779,63 @@ OpenMPIRBuilder::createTeams(const LocationDescription , BasicBlock *AllocaBB = splitBB(Builder, /*CreateBranch=*/true, "teams.alloca"); + // Generate the body of teams. + InsertPointTy AllocaIP(AllocaBB, AllocaBB->begin()); + InsertPointTy

[clang] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -1736,26 +1750,20 @@ OpenMPIRBuilder::createTask(const LocationDescription , StaleCI->eraseFromParent(); -// Emit the body for wrapper function -BasicBlock *WrapperEntryBB = -BasicBlock::Create(M.getContext(), "", WrapperFunc); -

[clang-tools-extra] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -1523,41 +1560,31 @@ OpenMPIRBuilder::createTask(const LocationDescription , BasicBlock *TaskAllocaBB = splitBB(Builder, /*CreateBranch=*/true, "task.alloca"); + InsertPointTy TaskAllocaIP = + InsertPointTy(TaskAllocaBB, TaskAllocaBB->begin()); +

[clang] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -1523,41 +1560,31 @@ OpenMPIRBuilder::createTask(const LocationDescription , BasicBlock *TaskAllocaBB = splitBB(Builder, /*CreateBranch=*/true, "task.alloca"); + InsertPointTy TaskAllocaIP = + InsertPointTy(TaskAllocaBB, TaskAllocaBB->begin()); +

[libunwind] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -1523,41 +1560,31 @@ OpenMPIRBuilder::createTask(const LocationDescription , BasicBlock *TaskAllocaBB = splitBB(Builder, /*CreateBranch=*/true, "task.alloca"); + InsertPointTy TaskAllocaIP = + InsertPointTy(TaskAllocaBB, TaskAllocaBB->begin()); +

[libunwind] [OpenMPIRBuilder] Remove wrapper function in `createTask`, `createTeams` (PR #67723)

2023-10-24 Thread Johannes Doerfert via cfe-commits
@@ -1736,26 +1750,20 @@ OpenMPIRBuilder::createTask(const LocationDescription , StaleCI->eraseFromParent(); -// Emit the body for wrapper function -BasicBlock *WrapperEntryBB = -BasicBlock::Create(M.getContext(), "", WrapperFunc); -

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1026,25 +1026,25 @@ for (int i = 0; i < argc; ++i) { // CHECK3-NEXT:call void @llvm.experimental.noalias.scope.decl(metadata [[META8:![0-9]+]]) // CHECK3-NEXT:call void @llvm.experimental.noalias.scope.decl(metadata [[META10:![0-9]+]]) // CHECK3-NEXT:call

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [OpenMP][OMPIRBuilder] Add support to omp target parallel (PR #67000)

2023-10-23 Thread Johannes Doerfert via cfe-commits
@@ -1126,6 +1133,185 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value *CancelFlag, Builder.SetInsertPoint(NonCancellationBlock, NonCancellationBlock->begin()); } +// Callback used to create OpenMP runtime calls to support +// omp parallel clause for the device. +//

[clang] [libc] Enable remaining string functions on the GPU (PR #68346)

2023-10-23 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. Seems a reasonable solution, given that nothing in this space is really nice and clean. Nobody complained for a while, LG. https://github.com/llvm/llvm-project/pull/68346 ___ cfe-commits

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,80 @@ +//===-- State.cpp - OpenMP State & ICV interface - 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] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
@@ -36,6 +46,15 @@ extern "C" { #pragma omp end declare variant #ifdef __AMDGCN__ +#pragma omp begin declare variant match( \ +device = {arch(amdgcn)}, \ +implementation

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From f3e7e4008cc2acf9101721efd0b7c736b7d982c0 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From 70619108a402b01c5f1f9d307a8cf21289849d74 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
@@ -15,9 +15,19 @@ #endif #ifdef __cplusplus +#include jdoerfert wrote: this is not freestanding https://github.com/llvm/llvm-project/pull/69806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From 50807ba3714b5556e9971f3f009fbd8bea70e15f Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/69806 >From d0df9cbcb01528760c45898891e175f915dddbb1 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Sat, 30 Sep 2023 23:37:28 -0700 Subject: [PATCH] [OpenMP] Basic BumpAllocator for (AMD)GPUs The patch

[clang] [OpenMP] Basic BumpAllocator for (AMD)GPUs (PR #69806)

2023-10-20 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert created https://github.com/llvm/llvm-project/pull/69806 The patch contains a basic BumpAllocator for (AMD)GPUs to allow us to run more tests. The allocator implements `malloc`, both internally and externally, while we continue to default to the NVIDIA `malloc`

[clang] [OpenMP][Clang] Force use of `num_teams` and `thread_limit` for bare kernel (PR #68373)

2023-10-06 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: I think the follow up, to force the user bound for bare kernels, make sense. I am not sold on this patch though. Why would we disallow users to do the same looping we do in the deviceRTL while hoping the offload runtime will pick a good grid size?

[clang] [OpenMP] Prevent AMDGPU from overriding visibility on DT_nohost variables (PR #68264)

2023-10-05 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG if others don't object https://github.com/llvm/llvm-project/pull/68264 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Prevent AMDGPU from overriding visibility on DT_nohost variables (PR #68264)

2023-10-05 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: Seems reasonable to me. https://github.com/llvm/llvm-project/pull/68264 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] Support compressing device binary (PR #67162)

2023-10-02 Thread Johannes Doerfert via cfe-commits
@@ -1183,6 +1183,10 @@ def fgpu_inline_threshold_EQ : Joined<["-"], "fgpu-inline-threshold=">, def fgpu_sanitize : Flag<["-"], "fgpu-sanitize">, Group, HelpText<"Enable sanitizer for supported offloading devices">; def fno_gpu_sanitize : Flag<["-"], "fno-gpu-sanitize">,

[libunwind] [OpenMP] Improve omp offload profiler (PR #68016)

2023-10-02 Thread Johannes Doerfert via cfe-commits
@@ -79,15 +79,15 @@ struct TimeTraceProfilerEntry { // Calculate timings for FlameGraph. Cast time points to microsecond precision jdoerfert wrote: Can you split the changes to this file into a separate PR? Also check the file, the comment still states

[clang] [Clang][OpenMP][OMPIRBuilder] Move Clang's OpenMP Member/MemberOf flag helpers into the OMPIRBuilder (PR #67844)

2023-09-30 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, tested via the clang tests. https://github.com/llvm/llvm-project/pull/67844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)

2023-09-29 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG, we need runtime tests in a follow up. https://github.com/llvm/llvm-project/pull/66844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [OpenMP] Implicitly include the 'cgpu' and 'mgpu' libraries for OpenMP (PR #67557)

2023-09-27 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert approved this pull request. LG https://github.com/llvm/llvm-project/pull/67557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)

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

[clang] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)

2023-09-26 Thread Johannes Doerfert via cfe-commits
@@ -752,27 +751,41 @@ void CGOpenMPRuntimeGPU::emitNonSPMDKernel(const OMPExecutableDirective , EntryFunctionState EST; WrapperFunctionsMap.clear(); + bool IsBareKernel = D.getSingleClause(); jdoerfert wrote: How can a non-spmd kernel be bare? We

[clang] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)

2023-09-26 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert commented: Where is the code that prevents the init/deinit calls from being created? https://github.com/llvm/llvm-project/pull/66844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Inliner] Improve attribute propagation to callsites when inlining. (PR #66036)

2023-09-25 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: > > I don't think 10 commit PRs are helpful. This should be 3 PRs at least. One > > is trivial, one is probably easy, and then one with the new stuff. > > So PR based on PR? The thing is there are dependencies between commits. My > expectation is that I will push commits as

[clang] [Inliner] Improve attribute propagation to callsites when inlining. (PR #66036)

2023-09-25 Thread Johannes Doerfert via cfe-commits
jdoerfert wrote: I don't think 10 commit PRs are helpful. This should be 3 PRs at least. One is trivial, one is probably easy, and then one with the new stuff. https://github.com/llvm/llvm-project/pull/66036 ___ cfe-commits mailing list

[clang] [OpenMP] Introduce the initial support for OpenMP kernel language (PR #66844)

2023-09-25 Thread Johannes Doerfert via cfe-commits
@@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -verify -fopenmp %s +// RUN: %clang_cc1 -verify -fopenmp-simd %s +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=nvptx64 %s + +void foo() { +} + +void bar() { +#pragma omp target ompx_bare // expected-error {{unexpected OpenMP clause

[clang] [Clang][OpenMP] Clang adding the addrSpace according to DataLayout fix (PR #65483)

2023-09-06 Thread Johannes Doerfert via cfe-commits
@@ -3362,6 +3362,8 @@ Address CGOpenMPRuntimeGPU::getAddressOfLocalVariable(CodeGenFunction , break; case OMPAllocateDeclAttr::OMPLargeCapMemAlloc: case OMPAllocateDeclAttr::OMPCGroupMemAlloc: + if (VD->hasGlobalStorage()) +AS =

[clang] 81792de - [OpenMP][FIX] Remove more version check lines

2023-08-23 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-08-23T12:02:28-07:00 New Revision: 81792de2b0a698d33a0685de698827f9f12320fd URL: https://github.com/llvm/llvm-project/commit/81792de2b0a698d33a0685de698827f9f12320fd DIFF:

[clang] b7a5492 - [OpenMP][FIX] Remove the version check line

2023-08-23 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-08-23T12:00:04-07:00 New Revision: b7a5492c1f84d7cff0a82e306f4d42374fb93879 URL: https://github.com/llvm/llvm-project/commit/b7a5492c1f84d7cff0a82e306f4d42374fb93879 DIFF:

[clang] 6ff70ec - [OpenMP][NFC] Remove typo in test name

2023-08-23 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-08-23T10:40:30-07:00 New Revision: 6ff70ec60eae2f973c46c5d1d6a28684f21f1cb4 URL: https://github.com/llvm/llvm-project/commit/6ff70ec60eae2f973c46c5d1d6a28684f21f1cb4 DIFF:

[clang] df8d33f - [OpenMP][AMDGPU] Add "amdgpu-flat-work-group-size" for known thread counts

2023-08-18 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-08-18T21:47:57-07:00 New Revision: df8d33fa7a22df3be34da5c6837031d897fa479b URL: https://github.com/llvm/llvm-project/commit/df8d33fa7a22df3be34da5c6837031d897fa479b DIFF:

[clang] 08a2207 - Reapply "[OpenMP] Add the `ompx_attribute` clause for target directives"

2023-07-25 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-07-25T10:40:35-07:00 New Revision: 08a220764b1e266c4694f614fd4fda7bd2122580 URL: https://github.com/llvm/llvm-project/commit/08a220764b1e266c4694f614fd4fda7bd2122580 DIFF:

[clang] ef9ec4b - [OpenMP] Add the `ompx_attribute` clause for target directives

2023-07-24 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-07-24T22:04:45-07:00 New Revision: ef9ec4bbcca2fa4f64df47bc426f1d1c59ea47e2 URL: https://github.com/llvm/llvm-project/commit/ef9ec4bbcca2fa4f64df47bc426f1d1c59ea47e2 DIFF:

[clang] 232ce90 - [OpenMP][FIX] Adjust "known" attributes for runtime functions

2023-07-14 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-07-14T17:01:48-07:00 New Revision: 232ce90541fe1bd1aa96319b36d8fe5b5344a52b URL: https://github.com/llvm/llvm-project/commit/232ce90541fe1bd1aa96319b36d8fe5b5344a52b DIFF:

[clang] b9f1df7 - Revert "[UTC] Add fallback support for specific metadata, and check their defs"

2023-07-14 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-07-14T13:53:37-07:00 New Revision: b9f1df7a04d7a3169623e437597aa4b32d99d8b3 URL: https://github.com/llvm/llvm-project/commit/b9f1df7a04d7a3169623e437597aa4b32d99d8b3 DIFF:

[clang] 5b8b9b3 - Revert "[UTC] Adapt version matcher to glob CLANG_VENDOR"

2023-07-14 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-07-14T13:53:36-07:00 New Revision: 5b8b9b39ccd06989b722f8d0adad0aa4da6d7d72 URL: https://github.com/llvm/llvm-project/commit/5b8b9b39ccd06989b722f8d0adad0aa4da6d7d72 DIFF:

[clang] 949830a - [OpenMP] Mark kernels as mustprogress

2023-06-05 Thread Johannes Doerfert via cfe-commits
Author: Johannes Doerfert Date: 2023-06-05T16:33:53-07:00 New Revision: 949830af4246688899657ac1974041804a143ae1 URL: https://github.com/llvm/llvm-project/commit/949830af4246688899657ac1974041804a143ae1 DIFF:

<    1   2   3   4   >