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
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
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
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation , const
InputInfoList ,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // information
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation , const
InputInfoList ,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // information
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation , const
InputInfoList ,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // information
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
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,
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation , const
InputInfoList ,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // information
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
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
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
@@ -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.
@@ -492,6 +493,18 @@ void Flang::addOffloadOptions(Compilation , const
InputInfoList ,
if (Args.hasArg(options::OPT_nogpulib))
CmdArgs.push_back("-nogpulib");
}
+
+ // For all the host OpenMP offloading compile jobs we need to pass the
targets
+ // information
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
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
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
@@ -705,28 +740,7 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase
,
};
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
,
return bodyGenStatus;
}
+static void
+buildDependData(Operation *op, LLVM::ModuleTranslation ,
skatrak wrote:
I'd suggest taking `std::optional depends` and `OperandRange
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:
@@ -705,28 +728,9 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase
,
};
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:
@@ -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:
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
@@ -5272,36 +5682,53 @@ static void emitTargetCall(OpenMPIRBuilder ,
IRBuilderBase ,
Value *DynCGGroupMem = Builder.getInt32(0);
bool HasNoWait = false;
+ bool HasDependencies = Dependencies.size() > 0;
+ bool RequiresOuterTargetTask = HasNoWait || HasDependencies;
https://github.com/skatrak commented:
Thanks for working on my previous comments. I just have a couple more minor
ones.
https://github.com/llvm/llvm-project/pull/93977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -223,9 +223,12 @@ class CodeGenAction : public FrontendAction {
std::unique_ptr llvmCtx;
std::unique_ptr llvmModule;
- /// Embeds offload objects given with specified with -fembed-offload-object
+ /// Embeds offload objects specified with -fembed-offload-object
https://github.com/skatrak closed
https://github.com/llvm/llvm-project/pull/94359
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
skatrak wrote:
Thank your for the reviews. Merging now since buildbot failure is unrelated.
https://github.com/llvm/llvm-project/pull/94359
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/skatrak updated
https://github.com/llvm/llvm-project/pull/94359
>From 88a2553168b4fd3ad1b65b855c2bdf5aba09d126 Mon Sep 17 00:00:00 2001
From: Sergio Afonso
Date: Tue, 4 Jun 2024 15:26:38 +0100
Subject: [PATCH 1/2] [Flang][OpenMP] Add -fopenmp-force-usm option to flang
This
@@ -705,28 +728,9 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase
,
};
SmallVector dds;
- if (!taskOp.getDependVars().empty() && taskOp.getDepends()) {
-for (auto dep :
- llvm::zip(taskOp.getDependVars(), taskOp.getDepends()->getValue())) {
-
@@ -1698,6 +1701,64 @@ void OpenMPIRBuilder::createTaskyield(const
LocationDescription ) {
emitTaskyieldImpl(Loc);
}
+// Processes the dependencies in Dependencies and does the following
+// - Allocates space on the stack of an array of DependInfo objects
+// - Populates
@@ -792,6 +792,9 @@ void OpenMPIRBuilder::finalize(Function *Fn) {
if (!OffloadInfoManager.empty())
createOffloadEntriesAndInfoMetadata(ErrorReportFn);
+
+ LLVM_DEBUG(dbgs() << "Module after OMPIRBuilder::finalize\n");
+ LLVM_DEBUG(dbgs() << M << "\n");
@@ -5272,36 +5682,53 @@ static void emitTargetCall(OpenMPIRBuilder ,
IRBuilderBase ,
Value *DynCGGroupMem = Builder.getInt32(0);
bool HasNoWait = false;
+ bool HasDependencies = Dependencies.size() > 0;
+ bool RequiresOuterTargetTask = HasNoWait || HasDependencies;
@@ -0,0 +1,37 @@
+! 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:
@@ -5212,6 +5273,78 @@ static Function *createOutlinedFunction(
return Func;
}
+// Create an entry point for a target task with the following.
+// It'll have the following signature
+// void @.omp_target_task_proxy_func(i32 %thread.id, ptr %task)
+// This function is called
@@ -5572,6 +5999,8 @@ void OpenMPIRBuilder::emitOffloadingArrays(
return;
Builder.restoreIP(AllocaIP);
+ LLVM_DEBUG(dbgs() << "Basicblock before emitOffloadingArrays\n"
+<< *(Builder.GetInsertBlock()) << "\n");
skatrak wrote:
Nit:
@@ -5252,6 +5660,8 @@ static void emitTargetCall(OpenMPIRBuilder ,
IRBuilderBase ,
// emitKernelLaunch
auto & =
[&](OpenMPIRBuilder::InsertPointTy IP) -> OpenMPIRBuilder::InsertPointTy
{
+LLVM_DEBUG(dbgs() << "EmitTargetCallFallbackCB::Builder = " <<
+
https://github.com/skatrak commented:
Thank you Pranav, I think this looks good. I just have a few minor comments.
https://github.com/llvm/llvm-project/pull/93977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
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 created
https://github.com/llvm/llvm-project/pull/94359
This patch enables the `-fopenmp-force-usm` option to be passed to the flang
driver, which forwards it to the compiler frontend. This flag, when set,
results in the introduction of the `unified_shared_memory`
@@ -665,60 +619,44 @@ bool
clang::isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind) {
}
bool clang::isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind) {
- return DKind == OMPD_teams || DKind == OMPD_teams_distribute ||
- DKind ==
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/80460
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef
HostFilePath) {
loadOffloadInfoMetadata(*M.get());
}
-Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) {
skatrak wrote:
> It was a very obvious problem. I
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef
HostFilePath) {
loadOffloadInfoMetadata(*M.get());
}
-Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) {
skatrak wrote:
The test itself has "requires
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef
HostFilePath) {
loadOffloadInfoMetadata(*M.get());
}
-Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) {
skatrak wrote:
Flang already picks up your changes to
@@ -6872,35 +6883,6 @@ void OpenMPIRBuilder::loadOffloadInfoMetadata(StringRef
HostFilePath) {
loadOffloadInfoMetadata(*M.get());
}
-Function *OpenMPIRBuilder::createRegisterRequires(StringRef Name) {
skatrak wrote:
Removing this function breaks the
https://github.com/skatrak commented:
I noticed a small breakage of the OpenMP MLIR dialect from one of these
changes. It should be trivial to address.
https://github.com/llvm/llvm-project/pull/80460
___
cfe-commits mailing list
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/80460
___
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/77760
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2178,7 +2178,7 @@
createAndSetPrivatizedLoopVar(Fortran::lower::AbstractConverter ,
template
static void createBodyOfOp(
Op , Fortran::lower::AbstractConverter , mlir::Location ,
-Fortran::lower::pft::Evaluation ,
+Fortran::lower::pft::Evaluation , bool
@@ -110,6 +110,34 @@ static void gatherFuncAndVarSyms(
}
}
+static Fortran::lower::pft::Evaluation *
+getCollapsedEval(Fortran::lower::pft::Evaluation , int collapseValue) {
skatrak wrote:
Nit: Maybe `getCollapsedLoopEval` would be slightly more
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/77758
___
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 for addressing my comments, LGTM.
https://github.com/llvm/llvm-project/pull/77758
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -3358,14 +3396,17 @@ genOMP(Fortran::lower::AbstractConverter ,
.t);
// Currently only private/firstprivate clause is handled, and
// all privatization is done within `omp.section` operations.
+ symTable.pushScope();
skatrak wrote:
https://github.com/skatrak approved this pull request.
LGTM, thanks! Please wait for one more approval before merging.
https://github.com/llvm/llvm-project/pull/73944
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -31,6 +31,15 @@ class Triple;
// back-end to TableGen to create these clean tables.
namespace AMDGPU {
+/// Address space values for AMD GPUs
+enum AddrSpace {
+ Generic = 0,
skatrak wrote:
I think it would be good to prefix these names with something so
@@ -405,9 +398,9 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final :
public TargetInfo {
getDWARFAddressSpace(unsigned AddressSpace) const override {
const unsigned DWARF_Private = 1;
const unsigned DWARF_Local = 2;
-if (AddressSpace == Private) {
+if
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/73944
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak commented:
Thanks for this work. I only have very little feedback, but it LGTM.
I think the enum looks a bit out of place in a file called "TargetParser.h",
but I'm not very familiar with this part of the project, so I'll let the
experts say something if there is a
https://github.com/skatrak commented:
Thank you Shraiysh, I just have a couple of nits.
https://github.com/llvm/llvm-project/pull/72770
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -590,6 +590,8 @@ class ClauseProcessor {
bool processSectionsReduction(mlir::Location currentLocation) const;
bool processTo(llvm::SmallVectorImpl )
const;
bool
+ processEnter(llvm::SmallVectorImpl ) const;
skatrak wrote:
Nit: It would be good to
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/72770
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1851,6 +1853,18 @@ bool ClauseProcessor::processTo(
});
}
+bool ClauseProcessor::processEnter(
+llvm::SmallVectorImpl ) const {
+ return findRepeatableClause(
+ [&](const ClauseTy::Enter *enterClause,
+ const Fortran::parser::CharBlock &) {
+
@@ -264,6 +263,37 @@ static void addDepdendentLibs(mlir::ModuleOp ,
}
}
+// Add to MLIR code target specific items which are dependent on target
+// configuration specified by the user
+static void addTargetSpecificMLIRItems(mlir::ModuleOp ,
+
@@ -264,6 +263,37 @@ static void addDepdendentLibs(mlir::ModuleOp ,
}
}
+// Add to MLIR code target specific items which are dependent on target
+// configuration specified by the user
+static void addTargetSpecificMLIRItems(mlir::ModuleOp ,
+
https://github.com/skatrak edited
https://github.com/llvm/llvm-project/pull/72638
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/skatrak commented:
Thanks for this work, Dominik. It LGTM, but please wait for another review
before merging. I have a couple of suggestions for small improvements, but let
me know if they would take significant effort to address, as I'm not completely
familiar with that
Author: Sergio Afonso
Date: 2023-09-14T10:35:44+01:00
New Revision: 9058762789c0a83560c2b567a347b993e70b05ae
URL:
https://github.com/llvm/llvm-project/commit/9058762789c0a83560c2b567a347b993e70b05ae
DIFF:
https://github.com/llvm/llvm-project/commit/9058762789c0a83560c2b567a347b993e70b05ae.diff
Author: Sergio Afonso
Date: 2023-09-14T10:33:54+01:00
New Revision: 094a63a20bf54f18efafbb6a727466da0f22a245
URL:
https://github.com/llvm/llvm-project/commit/094a63a20bf54f18efafbb6a727466da0f22a245
DIFF:
https://github.com/llvm/llvm-project/commit/094a63a20bf54f18efafbb6a727466da0f22a245.diff
Author: Sergio Afonso
Date: 2023-08-10T11:54:45+01:00
New Revision: e5a524b8b5e9d11fbb12ad8ed9b2d998e05e6119
URL:
https://github.com/llvm/llvm-project/commit/e5a524b8b5e9d11fbb12ad8ed9b2d998e05e6119
DIFF:
https://github.com/llvm/llvm-project/commit/e5a524b8b5e9d11fbb12ad8ed9b2d998e05e6119.diff
Author: Sergio Afonso
Date: 2023-08-07T11:18:43+01:00
New Revision: ec70627dd17703a2a12ce0f28bd3794aa77d2058
URL:
https://github.com/llvm/llvm-project/commit/ec70627dd17703a2a12ce0f28bd3794aa77d2058
DIFF:
https://github.com/llvm/llvm-project/commit/ec70627dd17703a2a12ce0f28bd3794aa77d2058.diff
Author: Sergio Afonso
Date: 2023-04-12T14:59:37+01:00
New Revision: 2266f4a3b38f4b59d313cdd2a9209952afb29d14
URL:
https://github.com/llvm/llvm-project/commit/2266f4a3b38f4b59d313cdd2a9209952afb29d14
DIFF:
https://github.com/llvm/llvm-project/commit/2266f4a3b38f4b59d313cdd2a9209952afb29d14.diff
Author: Sergio Afonso
Date: 2023-03-24T17:13:40Z
New Revision: 33be83415c9b5e9a874fcbddee8e64ecf464c203
URL:
https://github.com/llvm/llvm-project/commit/33be83415c9b5e9a874fcbddee8e64ecf464c203
DIFF:
https://github.com/llvm/llvm-project/commit/33be83415c9b5e9a874fcbddee8e64ecf464c203.diff
80 matches
Mail list logo