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
@@ -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 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
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 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 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 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 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 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 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/116219
___
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 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 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 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
@@ -2378,7 +2464,7 @@ convertOmpParallel(omp::ParallelOp opInst,
llvm::IRBuilderBase &builder,
llvm::OpenMPIRBuilder::InsertPointOrErrorTy contInsertPoint =
ompBuilder->createReductions(builder.saveIP(), allocaIP,
- reduct
@@ -1987,7 +1984,8 @@ class OpenMPIRBuilder {
InsertPointTy AllocaIP,
ArrayRef ReductionInfos,
ArrayRef IsByRef,
-bool
@@ -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 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
@@ -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);
-
@@ -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
@@ -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 +
@@ -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
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
@@ -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
@@ -3688,27 +3708,95 @@ static Function *getFreshReductionFunc(Module &M) {
".omp.reduction.func", &M);
}
-OpenMPIRBuilder::InsertPointOrErrorTy
-OpenMPIRBuilder::createReductions(const LocationDescription &Loc,
- Inse
@@ -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
@@ -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
@@ -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;
+
@@ -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
@@ -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
@@ -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
@@ -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.
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 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 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
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 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 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 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
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
101 - 149 of 149 matches
Mail list logo