@@ -2378,7 +2464,7 @@ convertOmpParallel(omp::ParallelOp opInst,
llvm::IRBuilderBase &builder,
llvm::OpenMPIRBuilder::InsertPointOrErrorTy contInsertPoint =
ompBuilder->createReductions(builder.saveIP(), allocaIP,
- reduct
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/134230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,71 @@
+// RUN: mlir-translate -mlir-to-llvmir -split-input-file %s | FileCheck %s
+
+// Only check the overall shape of the code and the presence of relevant
+// runtime calls. Actual IR checking is done at the OpenMPIRBuilder level.
+
+omp.private {type = private} @_QF
@@ -1987,7 +1984,8 @@ class OpenMPIRBuilder {
InsertPointTy AllocaIP,
ArrayRef ReductionInfos,
ArrayRef IsByRef,
-bool
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/133310
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
skatrak wrote:
I think we should have another test similar to this for the GPU, since codegen
for it is different.
https://github.com/llvm/llvm-project/pull/133310
___
cfe-commits mailing list
cfe-commits@lists.llvm.
@@ -1714,6 +1727,42 @@ convertOmpSingle(omp::SingleOp &singleOp,
llvm::IRBuilderBase &builder,
return success();
}
+static bool teamsReductionContainedInDistribute(omp::TeamsOp teamsOp) {
+ auto iface =
+ llvm::cast(teamsOp.getOperation());
+ // Check that all uses o
https://github.com/skatrak approved this pull request.
Thanks, LGTM!
https://github.com/llvm/llvm-project/pull/133310
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/133310
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/134230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/134230
>From 5a3bf580e8c22b9813c082d1249b9b99823241f1 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Wed, 2 Apr 2025 16:34:38 +0100
Subject: [PATCH] [Flang][OpenMP][Driver][AMDGPU] Fix -mcode-object-version
This p
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/134230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/134230
This patch updates flang to follow clang's behavior when processing the
`-mcode-object-version option`.
It is now used to populate an LLVM module flag called
`amdhsa_code_object_version` expected by the backen
@@ -3832,38 +3920,13 @@ OpenMPIRBuilder::createReductions(const
LocationDescription &Loc,
// Populate the outlined reduction function using the elementwise reduction
// function. Partial values are extracted from the type-erased array of
// pointers to private variables.
@@ -3688,27 +3708,95 @@ static Function *getFreshReductionFunc(Module &M) {
".omp.reduction.func", &M);
}
-OpenMPIRBuilder::InsertPointOrErrorTy
-OpenMPIRBuilder::createReductions(const LocationDescription &Loc,
- Inse
@@ -4161,6 +4247,37 @@ convertOmpDistribute(Operation &opInst,
llvm::IRBuilderBase &builder,
if (failed(checkImplementationStatus(opInst)))
return failure();
+ /// Process teams op reduction in distribute if the reduction is contained in
+ /// the distribute op.
+ om
@@ -1018,19 +1017,31 @@ allocReductionVars(T loop, ArrayRef
reductionArgs,
// variable allocated in the inlined region)
llvm::Value *var = builder.CreateAlloca(
moduleTranslation.convertType(reductionDecls[i].getType()));
- deferredStores.emplace_bac
@@ -4554,6 +4679,25 @@ static std::optional extractConstInteger(Value
value) {
return std::nullopt;
}
+static uint64_t getTypeByteSize(mlir::Type type, const DataLayout &dl) {
+ uint64_t sizeInBits = dl.getTypeSizeInBits(type);
+ uint64_t sizeInBytes = sizeInBits / 8;
+
@@ -4645,12 +4789,23 @@ initTargetDefaultAttrs(omp::TargetOp targetOp,
Operation *capturedOp,
(maxThreadsVal >= 0 && maxThreadsVal < combinedMaxThreadsVal))
combinedMaxThreadsVal = maxThreadsVal;
+ // Calculate reduction data size, limited to single reduction varia
@@ -4434,10 +4497,24 @@ getKmpcForStaticLoopForType(Type *Ty, OpenMPIRBuilder
*OMPBuilder,
static void createTargetLoopWorkshareCall(
OpenMPIRBuilder *OMPBuilder, WorksharingLoopType LoopType,
BasicBlock *InsertBlock, Value *Ident, Value *LoopBodyArg,
-Type *Parall
@@ -4434,10 +4497,24 @@ getKmpcForStaticLoopForType(Type *Ty, OpenMPIRBuilder
*OMPBuilder,
static void createTargetLoopWorkshareCall(
OpenMPIRBuilder *OMPBuilder, WorksharingLoopType LoopType,
BasicBlock *InsertBlock, Value *Ident, Value *LoopBodyArg,
-Type *Parall
@@ -1714,6 +1727,43 @@ convertOmpSingle(omp::SingleOp &singleOp,
llvm::IRBuilderBase &builder,
return success();
}
+static bool teamsReductionContainedInDistribute(omp::TeamsOp teamsOp) {
+ auto iface =
+ llvm::cast(teamsOp.getOperation());
+ // Check that all uses o
https://github.com/skatrak commented:
Thank you Jan, I have a few superficial comments, but the approach LGTM.
https://github.com/llvm/llvm-project/pull/133310
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailm
@@ -53,6 +53,79 @@ that:
* It has been tested in a very limited way so far.
* It has been tested mostly on simple synthetic inputs.
+### Loop nest detection
+
+On the `FIR` dialect level, the following loop:
+```fortran
+ do concurrent(i=1:n, j=1:m, k=1:o)
+a(i,j,k) = i +
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/127595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak approved this pull request.
LGTM, thank you!
https://github.com/llvm/llvm-project/pull/127595
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -31,6 +158,14 @@ class DoConcurrentConversion : public
mlir::OpConversionPattern {
mlir::LogicalResult
matchAndRewrite(fir::DoLoopOp doLoop, OpAdaptor adaptor,
mlir::ConversionPatternRewriter &rewriter) const override {
+looputils::LoopNest loopNes
@@ -53,6 +53,79 @@ that:
* It has been tested in a very limited way so far.
* It has been tested mostly on simple synthetic inputs.
+### Loop nest detection
+
+On the `FIR` dialect level, the following loop:
+```fortran
+ do concurrent(i=1:n, j=1:m, k=1:o)
+a(i,j,k) = i +
@@ -0,0 +1,155 @@
+
+
+# `DO CONCURRENT` mapping to OpenMP
+
+```{contents}
+---
+local:
+---
+```
+
+This document seeks to describe the effort to parallelize `do concurrent` loops
+by mapping them to OpenMP worksharing constructs. The goals of this document
+are:
+* Describing h
@@ -292,7 +298,19 @@ createTargetMachine(llvm::StringRef targetTriple,
std::string &error) {
static llvm::LogicalResult runOpenMPPasses(mlir::ModuleOp mlirModule) {
mlir::PassManager pm(mlirModule->getName(),
mlir::OpPassManager::Nesting::Implicit);
-
https://github.com/skatrak commented:
Sorry @ergawy for the delay getting back to this. LGTM, I just have one
remaining concern.
https://github.com/llvm/llvm-project/pull/126026
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
@@ -0,0 +1,104 @@
+//===- DoConcurrentConversion.cpp -- map `DO CONCURRENT` to OpenMP loops
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Ap
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/126026
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/116219
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/116052
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/117875
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/116051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/116051
>From 0c19f7119c1da0646466b0eb1c3c77faedabaebf Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Wed, 27 Nov 2024 11:33:01 +
Subject: [PATCH] [OMPIRBuilder] Support runtime number of teams and threads,
and
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/116051
>From 1f5cd91c67e12e19dd9a142273af5a90a63cbf38 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Wed, 27 Nov 2024 11:33:01 +
Subject: [PATCH] [OMPIRBuilder] Support runtime number of teams and threads,
and
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/116051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/116050
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/116050
>From 219d430cf7697eb2c4bcb5832695571ff472e0e2 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Fri, 8 Nov 2024 15:46:48 +
Subject: [PATCH] [OMPIRBuilder] Introduce struct to hold default kernel
teams/thr
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/116050
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/115863
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/115863
>From 23af823f4a4446d80130f9820f0a3d90ce2d999b Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 12 Nov 2024 12:41:15 +
Subject: [PATCH] [OpenMP][OMPIRBuilder] Handle non-failing calls properly
The pr
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/115863
>From 23af823f4a4446d80130f9820f0a3d90ce2d999b Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 12 Nov 2024 12:41:15 +
Subject: [PATCH] [OpenMP][OMPIRBuilder] Handle non-failing calls properly
The pr
https://github.com/skatrak approved this pull request.
Thank you, I think this is a good first step. Eventually, I think we'll still
have to introduce proper support for `-fc1as`, because `-fno-integrated-as`
(this patch making it the default for Flang) results in target offload programs
faili
@@ -345,18 +344,15 @@ TEST_F(OpenMPIRBuilderTest, CreateBarrier) {
IRBuilder<> Builder(BB);
- OpenMPIRBuilder::InsertPointOrErrorTy BarrierIP1 =
- OMPBuilder.createBarrier({IRBuilder<>::InsertPoint()}, OMPD_for);
- assert(BarrierIP1 && "unexpected error");
+ ASSERT_
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/115863
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
skatrak wrote:
Thank you @Meinersbur for your comments. I just updated the PR description and
replaced `cantFail()` calls in unit tests as you suggested, let me know if that
addresses your concerns.
https://github.com/llvm/llvm-project/pull/115863
__
@@ -2331,8 +2332,11 @@ void CGOpenMPRuntime::emitBarrierCall(CodeGenFunction
&CGF, SourceLocation Loc,
auto *OMPRegionInfo =
dyn_cast_or_null(CGF.CapturedStmtInfo);
if (CGF.CGM.getLangOpts().OpenMPIRBuilder) {
-CGF.Builder.restoreIP(OMPBuilder.createBarrier(
-
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/115863
The preprocessor definition used to enable asserts and the one that
`llvm::Error` and `llvm::Expected` use to ensure all created instances are
checked are not the same. By making these checks inside of an `asse
@@ -2331,8 +2332,11 @@ void CGOpenMPRuntime::emitBarrierCall(CodeGenFunction
&CGF, SourceLocation Loc,
auto *OMPRegionInfo =
dyn_cast_or_null(CGF.CapturedStmtInfo);
if (CGF.CGM.getLangOpts().OpenMPIRBuilder) {
-CGF.Builder.restoreIP(OMPBuilder.createBarrier(
-
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/112533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/112533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1103,6 +1105,13 @@ bool ConstructDecompositionT::applyClause(
return applyToOutermost(node);
}
+template
+bool ConstructDecompositionT::applyClause(
+const tomp::clause::OmpxBareT &clause,
+const ClauseTy *node) {
+ return applyToAll(node);
ska
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/06
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -350,6 +350,10 @@ bool
ClauseProcessor::processNowait(mlir::omp::NowaitClauseOps &result) const {
return markClauseOccurrence(result.nowait);
}
+bool ClauseProcessor::processBare(mlir::omp::BareClauseOps &result) const {
skatrak wrote:
Nit: Move above `
@@ -1672,8 +1672,9 @@ void TargetOp::build(OpBuilder &builder, OperationState
&state,
// TODO Store clauses in op: allocateVars, allocatorVars, inReductionVars,
// inReductionByref, inReductionSyms.
TargetOp::build(builder, state, /*allocate_vars=*/{}, /*allocator_vars=*
https://github.com/skatrak approved this pull request.
Thank you Ivan, Flang and MLIR changes look good to me. Sorry for the delay
getting back to this!
https://github.com/llvm/llvm-project/pull/06
___
cfe-commits mailing list
cfe-commits@lists.ll
@@ -1496,7 +1507,8 @@ IRBuilder<>::InsertPoint OpenMPIRBuilder::createParallel(
// Let the caller create the body.
assert(BodyGenCB && "Expected body generation callback!");
InsertPointTy CodeGenIP(PRegBodyBB, PRegBodyBB->begin());
- BodyGenCB(InnerAllocaIP, CodeGenIP);
@@ -1171,12 +1179,15 @@ void OpenMPIRBuilder::emitCancelationCheckImpl(Value
*CancelFlag,
// post finalization block that is known to the FiniCB callback.
Builder.SetInsertPoint(CancellationBlock);
if (ExitCB)
-ExitCB(Builder.saveIP());
+if (Error Err = ExitCB(Bu
@@ -2331,8 +2332,10 @@ void CGOpenMPRuntime::emitBarrierCall(CodeGenFunction
&CGF, SourceLocation Loc,
auto *OMPRegionInfo =
dyn_cast_or_null(CGF.CapturedStmtInfo);
if (CGF.CGM.getLangOpts().OpenMPIRBuilder) {
-CGF.Builder.restoreIP(OMPBuilder.createBarrier(
-
@@ -2331,8 +2332,10 @@ void CGOpenMPRuntime::emitBarrierCall(CodeGenFunction
&CGF, SourceLocation Loc,
auto *OMPRegionInfo =
dyn_cast_or_null(CGF.CapturedStmtInfo);
if (CGF.CGM.getLangOpts().OpenMPIRBuilder) {
-CGF.Builder.restoreIP(OMPBuilder.createBarrier(
-
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/112533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/112533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak ready_for_review
https://github.com/llvm/llvm-project/pull/112533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1103,6 +1105,13 @@ bool ConstructDecompositionT::applyClause(
return applyToOutermost(node);
}
+template
+bool ConstructDecompositionT::applyClause(
+const tomp::clause::OmpxBareT &clause,
+const ClauseTy *node) {
+ return applyToAll(node);
ska
@@ -1103,6 +1105,13 @@ bool ConstructDecompositionT::applyClause(
return applyToOutermost(node);
}
+template
+bool ConstructDecompositionT::applyClause(
+const tomp::clause::OmpxBareT &clause,
+const ClauseTy *node) {
+ return applyToAll(node);
ska
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/100154
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/100152
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From e59c38db58ba5ca2eef66d3b3477d5ad81043228 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH 1/2] [Flang][Driver] Introduce -fopenmp-targets offloading
optio
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From e59c38db58ba5ca2eef66d3b3477d5ad81043228 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH] [Flang][Driver] Introduce -fopenmp-targets offloading option
Th
skatrak wrote:
Thank you all for your reviews. I think it should be ok to merge at this point,
but I'll wait until tomorrow to give some time in case there are any remaining
concerns about this change.
https://github.com/llvm/llvm-project/pull/100152
___
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From 3861b28deeb1b558f182f2ab5680b123fd94c005 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH] [Flang][Driver] Introduce -fopenmp-targets offloading option
Th
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const
InputInfoList &Inputs,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // info
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const
InputInfoList &Inputs,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // info
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const
InputInfoList &Inputs,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // info
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From cf26a318d3b49eb6217f29405cee9fd2c20f8e8a Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH 1/5] [Flang][Driver] Introduce -fopenmp-targets offloading
optio
skatrak wrote:
> The only issue I see is that this PR adds a new driver flag that may be used
> to compile the applications. Renaming the user visible flags is not that
> easy. But if they get renamed before any compiler release then it should be
> fine.
Thank you for the comment. Actually, t
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const
InputInfoList &Inputs,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // info
skatrak wrote:
I'm not very knowledgeable on the set of offloading-related options clang
supports, how those impact the set of invocations and options produced by the
driver, or how these options eventually impact passes and codegen. Much less
about potential shortcomings and improvements to t
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From cf26a318d3b49eb6217f29405cee9fd2c20f8e8a Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH 1/4] [Flang][Driver] Introduce -fopenmp-targets offloading
optio
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From cf26a318d3b49eb6217f29405cee9fd2c20f8e8a Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH 1/3] [Flang][Driver] Introduce -fopenmp-targets offloading
optio
@@ -227,3 +227,20 @@
! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm"
! FORCE-USM-OFFLOAD-NEXT: "{{[^"]*}}flang-new" "-fc1" "-triple"
"amdgcn-amd-amdhsa"
! FORCE-USM-OFFLOAD-SAME: "-fopenmp" "-fopenmp-force-usm"
+
skatrak wrote:
Done.
https://github
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation &C, const
InputInfoList &Inputs,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // info
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/100152
>From cf26a318d3b49eb6217f29405cee9fd2c20f8e8a Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 23 Jul 2024 16:19:55 +0100
Subject: [PATCH 1/2] [Flang][Driver] Introduce -fopenmp-targets offloading
optio
skatrak wrote:
> Code changes look good to me. I can't speak to the needs of anyone else using
> offloading.
>
> I see this is copied exactly from `Toolchains/Clang.cpp`. I think that's okay
> for such a small bit of code.
Thank you for the quick review. Yes, it's basically copied from clang,
https://github.com/skatrak created
https://github.com/llvm/llvm-project/pull/100152
This patch modifies the flang driver to introduce the `-fopenmp-targets` option
to the frontend compiler invocations corresponding to the OpenMP host device on
offloading-enabled compilations.
This option hold
@@ -705,28 +740,7 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase
&builder,
};
SmallVector dds;
- if (!taskOp.getDependVars().empty() && taskOp.getDepends()) {
-for (auto dep :
- llvm::zip(taskOp.getDependVars(), taskOp.getDepends()->getValue()))
@@ -682,6 +682,41 @@ convertOmpTeams(omp::TeamsOp op, llvm::IRBuilderBase
&builder,
return bodyGenStatus;
}
+static void
+buildDependData(Operation *op, LLVM::ModuleTranslation &moduleTranslation,
skatrak wrote:
I'd suggest taking `std::optional depends` a
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/93977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak approved this pull request.
Thank you Pranav, LGTM. I have just one more comment but no need to wait for
another review by me before merging this. Just make sure @Meinersbur is happy
with it as well!
https://github.com/llvm/llvm-project/pull/93977
___
@@ -0,0 +1,83 @@
+! Offloading test checking the use of the depend clause on
+! the target construct
+! REQUIRES: flang, amdgcn-amd-amdhsa
+! UNSUPPORTED: nvptx64-nvidia-cuda
+! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+! UNSUPPORTED: aarch64-unknown-linux-gnu
+! UNSUPPORTED: aarch64-
@@ -705,28 +728,9 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase
&builder,
};
SmallVector dds;
- if (!taskOp.getDependVars().empty() && taskOp.getDepends()) {
-for (auto dep :
- llvm::zip(taskOp.getDependVars(), taskOp.getDepends()->getValue()))
@@ -0,0 +1,83 @@
+! Offloading test checking the use of the depend clause on
+! the target construct
+! REQUIRES: flang, amdgcn-amd-amdhsa
+! UNSUPPORTED: nvptx64-nvidia-cuda
+! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+! UNSUPPORTED: aarch64-unknown-linux-gnu
+! UNSUPPORTED: aarch64-
@@ -0,0 +1,83 @@
+! Offloading test checking the use of the depend clause on
+! the target construct
+! REQUIRES: flang, amdgcn-amd-amdhsa
+! UNSUPPORTED: nvptx64-nvidia-cuda
+! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+! UNSUPPORTED: aarch64-unknown-linux-gnu
+! UNSUPPORTED: aarch64-
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/93977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5229,13 +5382,284 @@ static void emitTargetOutlinedFunction(
OMPBuilder.emitTargetRegionFunction(EntryInfo, GenerateOutlinedFunction,
true,
OutlinedFn, OutlinedFnID);
}
+OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::emitTargetTask(
@@ -5272,36 +5682,53 @@ static void emitTargetCall(OpenMPIRBuilder &OMPBuilder,
IRBuilderBase &Builder,
Value *DynCGGroupMem = Builder.getInt32(0);
bool HasNoWait = false;
+ bool HasDependencies = Dependencies.size() > 0;
+ bool RequiresOuterTargetTask = HasNoWait || Ha
1 - 100 of 149 matches
Mail list logo