@@ -0,0 +1,44 @@
+// RUN: fir-opt --omp-automap-to-target-data %s | FileCheck %s
+// Test OMP AutomapToTargetData pass.
+
+module {
+ fir.global
+ @_QMtestEarr{omp.declare_target = #omp.declaretarget} target
+ : !fir.box>>
+
+ func.func @automap()
@@ -0,0 +1,44 @@
+// RUN: fir-opt --omp-automap-to-target-data %s | FileCheck %s
+// Test OMP AutomapToTargetData pass.
+
+module {
+ fir.global
+ @_QMtestEarr{omp.declare_target = #omp.declaretarget} target
+ : !fir.box>>
+
+ func.func @automap()
@@ -72,6 +77,36 @@ struct EntryBlockArgs {
/// \param [in] region - Empty region in which to create the entry block.
mlir::Block *genEntryBlock(
mlir::OpBuilder &builder, const EntryBlockArgs &args, mlir::Region
®ion);
+
+// Returns true if the variable has a dynamic size
@@ -0,0 +1,130 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
@@ -0,0 +1,44 @@
+// RUN: fir-opt --omp-automap-to-target-data %s | FileCheck %s
+// Test OMP AutomapToTargetData pass.
+
+module {
+ fir.global
+ @_QMtestEarr{omp.declare_target = #omp.declaretarget} target
+ : !fir.box>>
+
+ func.func @automap()
@@ -72,6 +77,36 @@ struct EntryBlockArgs {
/// \param [in] region - Empty region in which to create the entry block.
mlir::Block *genEntryBlock(
mlir::OpBuilder &builder, const EntryBlockArgs &args, mlir::Region
®ion);
+
+// Returns true if the variable has a dynamic size
https://github.com/skatrak approved this pull request.
Thank you again Akash, LGTM minus some NFC suggestions. Please wait for
@bhandarkar-pranav's approval before merging.
https://github.com/llvm/llvm-project/pull/151989
___
llvm-branch-commits maili
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/151989
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/151989
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -316,13 +316,13 @@ void createOpenMPFIRPassPipeline(mlir::PassManager &pm,
pm.addPass(flangomp::createDoConcurrentConversionPass(
opts.doConcurrentMappingKind == DoConcurrentMappingKind::DCMK_Device));
- // The MapsForPrivatizedSymbols pass needs to run before
@@ -0,0 +1,171 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
@@ -316,13 +316,13 @@ void createOpenMPFIRPassPipeline(mlir::PassManager &pm,
pm.addPass(flangomp::createDoConcurrentConversionPass(
opts.doConcurrentMappingKind == DoConcurrentMappingKind::DCMK_Device));
- // The MapsForPrivatizedSymbols pass needs to run before
@@ -0,0 +1,40 @@
+// RUN: fir-opt --omp-automap-to-target-data %s | FileCheck %s
+// Test OMP AutomapToTargetData pass.
+
+module {
+ fir.global
+ @_QMtestEarr{omp.declare_target = #omp.declaretarget} target
+ : !fir.box>>
+
+ func.func @automap()
@@ -0,0 +1,171 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
@@ -0,0 +1,171 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
@@ -0,0 +1,171 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
@@ -0,0 +1,171 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
@@ -0,0 +1,171 @@
+//===- AutomapToTargetData.cpp ---===//
+//
+// 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: Apac
https://github.com/skatrak commented:
Thank you Akash, a couple of minor comments from me.
https://github.com/llvm/llvm-project/pull/151989
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/150927
>From a26b2a03629f3ea8a9852a77db49df73f15115f4 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 25 Jul 2025 13:52:11 +0100
Subject: [PATCH] [OpenMPOpt] Make parallel regions reachable from new
DeviceRTL
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/150926
>From 6a81001ec131371c981e789f3dd402fb277e3c62 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 4 Jul 2025 16:32:03 +0100
Subject: [PATCH] [OpenMP][OMPIRBuilder] Support parallel in Generic kernels
This
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/150925
>From 8b344026f04bd417bb919c866b850d4474639d62 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Thu, 3 Jul 2025 16:47:51 +0100
Subject: [PATCH 1/2] [OpenMP][OMPIRBuilder] Use device shared memory for arg
stru
https://github.com/skatrak commented:
Thank you Kareem for your comments, I got pulled into other work and wasn't
able to reply properly until now.
https://github.com/llvm/llvm-project/pull/137201
___
llvm-branch-commits mailing list
llvm-branch-commi
@@ -3173,19 +3173,14 @@ convertOmpThreadprivate(Operation &opInst,
llvm::IRBuilderBase &builder,
LLVM::GlobalOp global =
addressOfOp.getGlobal(moduleTranslation.symbolTable());
llvm::GlobalValue *globalValue = moduleTranslation.lookupGlobal(global);
-
- if (!ompBuil
@@ -5488,40 +5483,172 @@ convertDeclareTargetAttr(Operation *op,
mlir::omp::DeclareTargetAttr attribute,
return success();
}
-// Returns true if the operation is inside a TargetOp or
-// is part of a declare target function.
-static bool isTargetDeviceOp(Operation *op) {
+n
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/137201
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
skatrak wrote:
PR stack:
- #150922
- #150923
- #150924
- #150925
- #150926
- #150927 ◀️
https://github.com/llvm/llvm-project/pull/150927
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/150927
>From b6c5ff874edf121b3801e773ad53608b01e8ebfd Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 25 Jul 2025 13:52:11 +0100
Subject: [PATCH] [OpenMPOpt] Make parallel regions reachable from new
DeviceRTL
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/150926
>From b6e9849e6b00eaa76f3d7ce0747fadf4f53c10d0 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 4 Jul 2025 16:32:03 +0100
Subject: [PATCH] [OpenMP][OMPIRBuilder] Support parallel in Generic kernels
This
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/150925
>From 8b344026f04bd417bb919c866b850d4474639d62 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Thu, 3 Jul 2025 16:47:51 +0100
Subject: [PATCH] [OpenMP][OMPIRBuilder] Use device shared memory for arg
structur
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/150924
This patch updates the allocation of some reduction and private variables
within target regions to use device shared memory rather than private memory.
This is a prerequisite to produce working Generic kernels
skatrak wrote:
PR stack:
- #150922
- #150923
- #150924 ◀️
- #150925
- #150926
- #150927
https://github.com/llvm/llvm-project/pull/150924
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
skatrak wrote:
PR stack:
- #150922
- #150923
- #150924
- #150925 ◀️
- #150926
- #150927
https://github.com/llvm/llvm-project/pull/150925
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
skatrak wrote:
PR stack:
- #150922
- #150923
- #150924
- #150925
- #150926 ◀️
- #150927
https://github.com/llvm/llvm-project/pull/150926
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
skatrak wrote:
PR stack:
- #150922
- #150923 ◀️
- #150924
- #150925
- #150926
- #150927
https://github.com/llvm/llvm-project/pull/150923
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/list
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/150927
This patch updates the OpenMP optimization pass to know about the new DeviceRTL
functions for loop constructs.
This change marks these functions as potentially containing parallel regions,
which fixes a curren
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/150925
Argument structures are created when sections of the LLVM IR corresponding to
an OpenMP construct are outlined into their own function. For this, stack
allocations are used.
This patch modifies this behavior w
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/150926
This patch introduces codegen logic to produce a wrapper function argument for
the `__kmpc_parallel_51` DeviceRTL function needed to handle arguments passed
using device shared memory in Generic mode.
>From 87
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/150923
This patch adds the `__kmpc_alloc_shared` and `__kmpc_free_shared` DeviceRTL
functions to the list of those the OMPIRBuilder is able to create.
>From f27aedb004854d46a2c36651d69cfcf23ebac181 Mon Sep 17 00:00:00
https://github.com/skatrak approved this pull request.
Thank you Tom for working on this, I think it's a very nice improvement! LGTM.
https://github.com/llvm/llvm-project/pull/144898
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.o
@@ -2224,10 +2260,13 @@ genSectionsOp(lower::AbstractConverter &converter,
lower::SymMap &symTable,
lower::pft::Evaluation &eval, mlir::Location loc,
const ConstructQueue &queue,
ConstructQueue::const_iterator item) {
- assert(!sectio
@@ -1818,16 +1852,17 @@ static void genTargetClauses(
llvm::SmallVectorImpl &hasDeviceAddrSyms,
llvm::SmallVectorImpl &isDevicePtrSyms,
llvm::SmallVectorImpl &mapSyms) {
+ HostEvalInfo *hostEvalInfo = getHostEvalInfoStackTop(converter);
ClauseProcessor cp(conver
@@ -2224,10 +2260,13 @@ genSectionsOp(lower::AbstractConverter &converter,
lower::SymMap &symTable,
lower::pft::Evaluation &eval, mlir::Location loc,
const ConstructQueue &queue,
ConstructQueue::const_iterator item) {
- assert(!sectio
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/144898
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -200,9 +201,41 @@ class HostEvalInfo {
/// the handling of the outer region by keeping a stack of information
/// structures, but it will probably still require some further work to support
/// reverse offloading.
-static llvm::SmallVector hostEvalInfo;
-static llvm::SmallVe
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137201
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137199
>From c6954b3120a87eef7d9cf86f18d4ef342b2e7b25 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 11 Apr 2025 13:40:14 +0100
Subject: [PATCH] [MLIR][OpenMP] Assert on map translation functions, NFC
This pa
https://github.com/skatrak approved this pull request.
Thank you, this LGTM. I just have a non-blocking suggestion.
https://github.com/llvm/llvm-project/pull/137841
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.l
@@ -3075,9 +3115,6 @@ convertOmpCancel(omp::CancelOp op, llvm::IRBuilderBase
&builder,
llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
llvm::OpenMPIRBuilder *ompBuilder = moduleTranslation.getOpenMPBuilder();
- if (failed(checkImplementationStatus(*op.getOper
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/137841
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/skatrak approved this pull request.
LGTM too, thanks!
https://github.com/llvm/llvm-project/pull/137205
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branc
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137201
>From 22f22aa0ca2c98dfcc48a70f2f7e0a5b68d7b1d9 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 22 Apr 2025 12:04:45 +0100
Subject: [PATCH] [MLIR][OpenMP] Simplify OpenMP device codegen
After removing ho
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137200
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
@@ -3623,6 +3623,9 @@ static llvm::omp::OpenMPOffloadMappingFlags
mapParentWithMembers(
LLVM::ModuleTranslation &moduleTranslation, llvm::IRBuilderBase &builder,
llvm::OpenMPIRBuilder &ompBuilder, DataLayout &dl, MapInfosTy
&combinedInfo,
MapInfoData &mapData, uin
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137201
>From c86caed6b80bdd4ed4edeb77f65116584e61b83b Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 22 Apr 2025 12:04:45 +0100
Subject: [PATCH] [MLIR][OpenMP] Simplify OpenMP device codegen
After removing ho
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137200
>From 6b734e2277969eeb200a292679c173c713b303f6 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 15 Apr 2025 16:59:18 +0100
Subject: [PATCH 1/2] [Flang][OpenMP] Minimize host ops remaining in device
compi
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/137199
>From 6ea52bf1986b5bba68d4d797590156daa38a4269 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 11 Apr 2025 13:40:14 +0100
Subject: [PATCH] [MLIR][OpenMP] Assert on map translation functions, NFC
This pa
skatrak wrote:
PR stack:
- #137198
- #137199
- #137200
- #137201
https://github.com/llvm/llvm-project/pull/137201
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit
skatrak wrote:
This PR is based on the following analysis of the current state of OpenMP map
translation to LLVM IR. If there are any issues with this PR, they are likely
easier to spot on this graph:
;
}
+
+/// Prepares the `fir.do_loop` nest to be easily mapped to OpenMP. In
+/// particular, this function would take this input IR:
+/// ```
+/// fir.do_loop %i_iv =
https://github.com/skatrak approved this pull request.
Thank you Kareem, LGTM!
https://github.com/llvm/llvm-project/pull/127634
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm
@@ -28,64 +28,80 @@ namespace looputils {
/// Stores info needed about the induction/iteration variable for each `do
/// concurrent` in a loop nest.
struct InductionVariableInfo {
+ InductionVariableInfo(fir::DoLoopOp doLoop) { populateInfo(doLoop); }
+
/// The operation al
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/127634
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/skatrak approved this pull request.
Thank you, LGTM!
https://github.com/llvm/llvm-project/pull/127633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch
@@ -5255,6 +5283,51 @@ convertTargetOpsInNest(Operation *op,
llvm::IRBuilderBase &builder,
return WalkResult::interrupt();
return WalkResult::skip();
}
+
+ // Non-target ops might nest target-related ops, therefore, we
+ //
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/127633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -24,7 +25,67 @@ namespace flangomp {
namespace {
namespace looputils {
-using LoopNest = llvm::SetVector;
+/// Stores info needed about the induction/iteration variable for each `do
+/// concurrent` in a loop nest.
+struct InductionVariableInfo {
+ /// The operation alloca
@@ -5255,6 +5283,51 @@ convertTargetOpsInNest(Operation *op,
llvm::IRBuilderBase &builder,
return WalkResult::interrupt();
return WalkResult::skip();
}
+
+ // Non-target ops might nest target-related ops, therefore, we
+ //
@@ -5315,6 +5320,46 @@ convertTargetOpsInNest(Operation *op,
llvm::IRBuilderBase &builder,
return WalkResult::interrupt();
return WalkResult::skip();
}
+
+ // Non-target ops might nest target-related ops, therefore, we
+ //
@@ -24,7 +25,50 @@ namespace flangomp {
namespace {
namespace looputils {
-using LoopNest = llvm::SetVector;
+/// Stores info needed about the induction/iteration variable for each `do
+/// concurrent` in a loop nest.
+struct InductionVariableInfo {
+ /// the operation alloca
@@ -0,0 +1,45 @@
+! Tests that if `do concurrent` is not perfectly nested in its parent loop,
that
+! we skip converting the not-perfectly nested `do concurrent` loop.
+
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=host %s -o - \
+! RUN: | FileCheck %s
+
+p
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/130789
This patch introduces a use for the new `getBlockArgsPairs` to avoid having to
manually list each applicable clause.
Also, the `numClauseBlockArgs()` function is introduced, which simplifies the
implementation
@@ -152,26 +199,140 @@ class DoConcurrentConversion : public
mlir::OpConversionPattern {
public:
using mlir::OpConversionPattern::OpConversionPattern;
- DoConcurrentConversion(mlir::MLIRContext *context, bool mapToDevice)
- : OpConversionPattern(context), mapToDevice(
@@ -24,7 +25,50 @@ namespace flangomp {
namespace {
namespace looputils {
-using LoopNest = llvm::SetVector;
+/// Stores info needed about the induction/iteration variable for each `do
+/// concurrent` in a loop nest.
+struct InductionVariableInfo {
+ /// the operation alloca
@@ -0,0 +1,45 @@
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fdo-concurrent-to-openmp=host %s -o - \
+! RUN: | FileCheck %s
+
+program main
+implicit none
+
+call foo(10)
+
+contains
+subroutine foo(n)
+implicit none
+integer :: n
+
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/125307
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/skatrak approved this pull request.
It appears a couple of the changes got somehow lost, but no need for another
review from me. LGTM, thanks!
https://github.com/llvm/llvm-project/pull/125307
___
llvm-branch-commits mailing list
llv
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127822
>From bd0589979a0db8bb6c5b7da57ac2054ce690a1f9 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Wed, 19 Feb 2025 15:15:01 +
Subject: [PATCH] [Flang][OpenMP] Allow host evaluation of loop bounds for
distri
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127821
>From 03651527c28805cb1d786c5674d4bf5644bd1642 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Wed, 19 Feb 2025 14:41:12 +
Subject: [PATCH] [MLIR][OpenMP] Support target SPMD
This patch implements MLIR t
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127820
>From aa6182cc887136d44c8fd180a702f62b381f9b5c Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 18 Feb 2025 14:19:30 +
Subject: [PATCH] [OpenMPIRBuilder] Split calculation of canonical loop trip
coun
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127819
>From e61c7975523361b02d1be6f270edfc4cdc6b4f66 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 18 Feb 2025 13:07:51 +
Subject: [PATCH] [MLIR][OpenMP] Host lowering of distribute-parallel-do/for
This
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127818
>From d164acf8d6a573cfc3e5a8d46f8d242fc3cd190f Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 18 Feb 2025 12:04:53 +
Subject: [PATCH] [OpenMPIRBuilder] Add support for distribute-parallel-for/do
co
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127817
>From 654c63e0489922e0abac069a95f2433d20f65e53 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 18 Feb 2025 11:22:43 +
Subject: [PATCH] [MLIR][OpenMP] Host lowering of standalone distribute
This patc
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/127816
>From 26638a2456dbc7b423d1f5bbb92650398f76098a Mon Sep 17 00:00:00 2001
From: Dominik Adamski
Date: Mon, 17 Feb 2025 14:25:40 +
Subject: [PATCH] [OpenMPIRBuilder] Add support for distribute constructs
This
@@ -102,6 +105,47 @@ mlir::Operation *findLoopIterationVarMemDecl(fir::DoLoopOp
doLoop) {
return result.getDefiningOp();
}
+/// Collects the op(s) responsible for updating a loop's iteration variable
with
+/// the current iteration number. For example, for the input IR:
+/
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/127635
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -0,0 +1,62 @@
+! Tests that "loop-local values" are properly handled by localizing them to the
+! body of the loop nest. See `collectLoopLocalValues` and
`localizeLoopLocalValue`
+! for a definition of "loop-local values" and how they are handled.
skatrak wrot
@@ -361,6 +361,64 @@ void sinkLoopIVArgs(mlir::ConversionPatternRewriter
&rewriter,
++idx;
}
}
+
+/// Collects values that are local to a loop: "loop-local values". A loop-local
+/// value is one that is used exclusively inside the loop but allocated outside
+/// of it.
@@ -202,6 +202,57 @@ variables: `i` and `j`. These are locally allocated inside
the parallel/target
OpenMP region similar to what the single-range example in previous section
shows.
+### Data environment
+
+By default, variables that are used inside a `do concurrent` loop nes
@@ -202,6 +202,57 @@ variables: `i` and `j`. These are locally allocated inside
the parallel/target
OpenMP region similar to what the single-range example in previous section
shows.
+### Data environment
+
+By default, variables that are used inside a `do concurrent` loop nes
https://github.com/skatrak approved this pull request.
I have a couple of nits, but LGTM otherwise. Thank you!
https://github.com/llvm/llvm-project/pull/127635
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.o
@@ -361,6 +361,64 @@ void sinkLoopIVArgs(mlir::ConversionPatternRewriter
&rewriter,
++idx;
}
}
+
+/// Collects values that are local to a loop: "loop-local values". A loop-local
+/// value is one that is used exclusively inside the loop but allocated outside
+/// of it.
@@ -152,26 +231,136 @@ class DoConcurrentConversion : public
mlir::OpConversionPattern {
public:
using mlir::OpConversionPattern::OpConversionPattern;
- DoConcurrentConversion(mlir::MLIRContext *context, bool mapToDevice)
- : OpConversionPattern(context), mapToDevice(
@@ -102,6 +105,47 @@ mlir::Operation *findLoopIterationVarMemDecl(fir::DoLoopOp
doLoop) {
return result.getDefiningOp();
}
+/// Collects the op(s) responsible for updating a loop's iteration variable
with
+/// the current iteration number. For example, for the input IR:
--
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/127634
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
1 - 100 of 684 matches
Mail list logo