[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add `OpenMP_Clause` tablegen definitions (PR #92521)

2024-05-20 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,1183 @@ +//=== OpenMPClauses.td - OpenMP dialect clause definitions -*- tablegen -*-===// +// +// 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: A

[llvm-branch-commits] [flang] [flang][omp] Emit omp.workshare in frontend (PR #101444)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/101444 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commi

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/101446 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: Thank you for all of the updates. This looks good to me in general, although I have a few minor questions. Before merging please make sure you document in the commit message exactly what is and is not supported. Please could another reviewer take an in-dept

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,446 @@ +//===- LowerWorkshare.cpp - special cases for bufferization ---===// +// +// 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: Apache-2.0

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,446 @@ +//===- LowerWorkshare.cpp - special cases for bufferization ---===// +// +// 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: Apache-2.0

[llvm-branch-commits] [mlir] [mlir][OpenMP] Convert reduction alloc region to LLVMIR (PR #102524)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/102524 >From 9e37da3b2eaace309d3b68fa36384430b5dc97cd Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 31 Jul 2024 10:10:33 + Subject: [PATCH] [mlir][OpenMP] Convert reduction alloc region to LLVMIR The intentio

[llvm-branch-commits] [flang] [flang][OpenMP] use reduction alloc region (PR #102525)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/102525 >From ee4a8e00d5c825ea3214199c460ea23af9c6ba6b Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 30 Jul 2024 10:56:36 + Subject: [PATCH] [flang][OpenMP] use reduction alloc region I removed the `*-hlfir*`

[llvm-branch-commits] [mlir] [mlir][OpenMP][NFC] clean up optional reduction region parsing (PR #105644)

2024-08-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/105644 This can be handled in ODS instead of writing custom parsing/printing code. Thanks for the idea @skatrak >From 84f097c970c751ad6779ce6d09baad854568c4b3 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 22 Aug

[llvm-branch-commits] [flang] [Flang][OpenMP] Move loop privatization out of dispatch (PR #106066)

2024-08-27 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/106066 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-comm

[llvm-branch-commits] [flang] [Flang][OpenMP] DISTRIBUTE PARALLEL DO lowering (PR #106207)

2024-08-27 Thread Tom Eccles via llvm-branch-commits
@@ -2052,8 +2074,69 @@ static void genCompositeDistributeParallelDo( semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, mlir::Location loc, const ConstructQueue &queue, ConstructQueue::const_iterator item) { + lower::StatementContext stmtCtx; +

[llvm-branch-commits] [flang] [Flang][OpenMP] DISTRIBUTE PARALLEL DO lowering (PR #106207)

2024-08-27 Thread Tom Eccles via llvm-branch-commits
@@ -2052,8 +2074,69 @@ static void genCompositeDistributeParallelDo( semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, mlir::Location loc, const ConstructQueue &queue, ConstructQueue::const_iterator item) { + lower::StatementContext stmtCtx; +

[llvm-branch-commits] [flang] [Flang][OpenMP] DISTRIBUTE PARALLEL DO lowering (PR #106207)

2024-08-27 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. This looks good to me https://github.com/llvm/llvm-project/pull/106207 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bra

[llvm-branch-commits] [flang] [Flang][OpenMP] DISTRIBUTE PARALLEL DO SIMD lowering (PR #106211)

2024-08-27 Thread Tom Eccles via llvm-branch-commits
tblah wrote: This looks good on its own. How many of these composite constructs are there in total? I'm wondering if there are enough that we should consider a more elaborate solution to avoid duplicating code (e.g. what if clause processing changes at some point). https://github.com/llvm/llv

[llvm-branch-commits] [flang] [Flang][OpenMP] DISTRIBUTE PARALLEL DO SIMD lowering (PR #106211)

2024-08-27 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. That sounds reasonable to me https://github.com/llvm/llvm-project/pull/106211 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/l

[llvm-branch-commits] [mlir] [MLIR][OpenMP][Docs] NFC: Document clause-based op representation (PR #107234)

2024-09-05 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107234 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [MLIR][OpenMP][Docs] NFC: Document loop representation (PR #107235)

2024-09-05 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107235 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] [MLIR][OpenMP][Docs] NFC: Document compound constructs representation (PR #107236)

2024-09-05 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thank you for writing all of these https://github.com/llvm/llvm-project/pull/107236 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[llvm-branch-commits] [flang] [flang] Introduce custom loop nest generation for loops in workshare construct (PR #101445)

2024-09-09 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/101445 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-09-10 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > @kiranchandramohan @tblah @skatrak I have a question to people more familiar > with Fortran and the Flang pipeline - is it possible that we would have CFG > (multiple blocks) in the IR generated in the `omp.workshare` region at this > point in the pipeline (immediately after low

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-09-10 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > I was wondering if there is some op that is like `scf.execute_region` but > already used in flang. Not that I am aware of. I think adding `scf.execute_region` might be the easiest way to support this. The alternative would be to go back and convert the if statement into CFG be

[llvm-branch-commits] [mlir] [MLIR][OpenMP][Docs] NFC: Document clause-based op representation (PR #107234)

2024-09-15 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/107234 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [llvm] [Flang] Move runtime library files to FortranRuntime. NFC (PR #110298)

2024-10-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/110298 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [llvm] [Flang] Move runtime library files to FortranRuntime. NFC (PR #110298)

2024-10-08 Thread Tom Eccles via llvm-branch-commits
@@ -1,15 +0,0 @@ -if (FLANG_CUF_RUNTIME) tblah wrote: why was this file deleted? https://github.com/llvm/llvm-project/pull/110298 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.ll

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-10-04 Thread Tom Eccles via llvm-branch-commits
@@ -96,6 +94,12 @@ bool shouldUseWorkshareLowering(Operation *op) { if (isNestedIn(parentWorkshare, op)) return false; + if (parentWorkshare.getRegion().getBlocks().size() != 1) { +parentWorkshare->emitWarning( +"omp workshare with unstructured control flow

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: I don't have a strong opinion about whether this should be done in flang codegen or in a runtime library. Some drive-by thoughts: - I imagine that using a C `omp for` inside of a fortran `omp parallel` should work **so long as they use the same openmp librar

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/113082 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
@@ -227,11 +227,11 @@ void createHLFIRToFIRPassPipeline(mlir::PassManager &pm, bool enableOpenMP, hlfir::createOptimizedBufferization); } pm.addPass(hlfir::createLowerHLFIROrderedAssignments()); + if (enableOpenMP) +pm.addPass(

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
@@ -335,49 +336,129 @@ static void parallelizeRegion(Region &sourceRegion, Region &targetRegion, for (auto [i, opOrSingle] : llvm::enumerate(regions)) { bool isLast = i + 1 == regions.size(); if (std::holds_alternative(opOrSingle)) { -OpBuilder singleBu

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
@@ -335,49 +336,129 @@ static void parallelizeRegion(Region &sourceRegion, Region &targetRegion, for (auto [i, opOrSingle] : llvm::enumerate(regions)) { bool isLast = i + 1 == regions.size(); if (std::holds_alternative(opOrSingle)) { -OpBuilder singleBu

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
@@ -335,49 +336,129 @@ static void parallelizeRegion(Region &sourceRegion, Region &targetRegion, for (auto [i, opOrSingle] : llvm::enumerate(regions)) { bool isLast = i + 1 == regions.size(); if (std::holds_alternative(opOrSingle)) { -OpBuilder singleBu

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > * I imagine that using a C `omp for` inside of a fortran `omp parallel` > should work **so long as they use the same openmp library**. Of course care > will need to be taken about privatisation etc but that can probably be > handled in the interface of the runtime function.

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Emit descriptive errors for all unsupported clauses (PR #114037)

2024-10-30 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks for this. Looks great! https://github.com/llvm/llvm-project/pull/114037 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[llvm-branch-commits] [flang] [flang][OpenMP] Parsing support for iterator in DEPEND clause (PR #113622)

2024-10-28 Thread Tom Eccles via llvm-branch-commits
@@ -795,35 +795,41 @@ bool ClauseProcessor::processCopyprivate( bool ClauseProcessor::processDepend(mlir::omp::DependClauseOps &result) const { fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder(); - return findRepeatableClause( - [&](const omp::clause::Depend

[llvm-branch-commits] [flang] [Flang][OpenMP] Access full list of entry block syms and vars (NFC) (PR #113681)

2024-10-28 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! Maybe sometime we could go a step further and provide a standard implementation of the `genRegionEntryCB`? https://github.com/llvm/llvm-project/pull/113681 ___ llvm-branch-commits mai

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > How do we usually have convergence on the definition of these runtime > functions when we introduce a library? Is it usually through a RFC? Because > if we think of vendors swapping implementations, does there need to be a > consensus prior to the implementation? To be clear, I

[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DOACROSS clause (PR #115397)

2024-11-11 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/115397 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DOACROSS clause (PR #115397)

2024-11-11 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks for this. LGTM with one nit https://github.com/llvm/llvm-project/pull/115397 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DOACROSS clause (PR #115397)

2024-11-11 Thread Tom Eccles via llvm-branch-commits
@@ -541,6 +541,7 @@ void OmpStructureChecker::Leave(const parser::OpenMPConstruct &) { } void OmpStructureChecker::Enter(const parser::OpenMPLoopConstruct &x) { + loopStack_.push_back(&x); tblah wrote: Thanks for the explanation! https://github.com/llvm/ll

[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DOACROSS clause (PR #115397)

2024-11-11 Thread Tom Eccles via llvm-branch-commits
@@ -1656,6 +1664,11 @@ void OmpStructureChecker::ChecksOnOrderedAsStandalone() { "Only SINK or SOURCE dependence types are allowed when ORDERED construct is a standalone construct with no ORDERED region"_err_en_US); } } + auto doaClauses = FindClauses(llvm::om

[llvm-branch-commits] [flang] [WIP][flang] Introduce HLFIR lowerings to omp.workshare_loop_nest (PR #104748)

2024-11-11 Thread Tom Eccles via llvm-branch-commits
tblah wrote: @ivanradanov is anything blocking this from becoming ready for review? https://github.com/llvm/llvm-project/pull/104748 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-11-11 Thread Tom Eccles via llvm-branch-commits
tblah wrote: @ivanradanov is there anything blocking these 4 patches? https://github.com/llvm/llvm-project/pull/101446 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-c

[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)

2024-10-23 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > They won't be able to that regardless. The OpenMP library will have to match > what Flang is using; otherwise, two OpenMP implementations will co-exist in > the same process and that's usually a recipe for problems. I probably wasn't clear. I meant something like `-fopenmp=libom

[llvm-branch-commits] [flang] [flang][OpenMP] Add version checks for clauses (PR #110015)

2024-09-26 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/110015 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-comm

[llvm-branch-commits] [flang] [flang][Semantics] Add LangOptions to SemanticsContext (PR #110013)

2024-09-26 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/110013 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-comm

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Improve omp.section block arguments handling (PR #110266)

2024-09-30 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/110266 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [mlir] [MLIR][OpenMP] Normalize representation of entry block arg-defining clauses (PR #109809)

2024-09-25 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks for the cleanup! https://github.com/llvm/llvm-project/pull/109809 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-b

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Document entry block argument-defining clauses (NFC) (PR #109811)

2024-09-25 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/109811 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-comm

[llvm-branch-commits] [flang] [flang][OpenMP] Extract OMP version hint into helper functions, NFC (PR #113621)

2024-10-25 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. https://github.com/llvm/llvm-project/pull/113621 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang] handle fir.call in AliasAnalysis::getModRef (PR #117164)

2024-11-25 Thread Tom Eccles via llvm-branch-commits
@@ -329,14 +341,92 @@ AliasResult AliasAnalysis::alias(Source lhsSrc, Source rhsSrc, mlir::Value lhs, // AliasAnalysis: getModRef //===--===// +static bool isSavedLocal(const fir::AliasAnalysis::Source &src)

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2024-11-25 Thread Tom Eccles via llvm-branch-commits
@@ -2701,7 +2701,42 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable, semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, const parser::OpenMPDeclareMapperConstruct &declareMapperConstruct) { - TODO(converter.getC

[llvm-branch-commits] [flang] [flang][hlfir] optimize hlfir.eval_in_mem bufferization (PR #118069)

2024-11-29 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM. Just some nitpicks. It is really good seeing how cleanly HLFIR extends to this new optimization. https://github.com/llvm/llvm-project/pull/118069 ___ llvm-branch-commits mailing list llvm-bran

[llvm-branch-commits] [flang] [flang][hlfir] optimize hlfir.eval_in_mem bufferization (PR #118069)

2024-11-29 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/118069 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang][hlfir] optimize hlfir.eval_in_mem bufferization (PR #118069)

2024-11-29 Thread Tom Eccles via llvm-branch-commits
@@ -1108,6 +1108,113 @@ class ReductionMaskConversion : public mlir::OpRewritePattern { } }; +class EvaluateIntoMemoryAssignBufferization +: public mlir::OpRewritePattern { + +public: + using mlir::OpRewritePattern::OpRewritePattern; + + llvm::LogicalResult + matchAn

[llvm-branch-commits] [flang] [flang][hlfir] optimize hlfir.eval_in_mem bufferization (PR #118069)

2024-11-29 Thread Tom Eccles via llvm-branch-commits
@@ -1108,6 +1108,113 @@ class ReductionMaskConversion : public mlir::OpRewritePattern { } }; +class EvaluateIntoMemoryAssignBufferization +: public mlir::OpRewritePattern { + +public: + using mlir::OpRewritePattern::OpRewritePattern; + + llvm::LogicalResult + matchAn

[llvm-branch-commits] [flang] [flang] optimize array function calls using hlfir.eval_in_mem (PR #118070)

2024-11-29 Thread Tom Eccles via llvm-branch-commits
@@ -134,7 +134,7 @@ end function f !CHECK-NEXT: run 1 save: where/mask !CHECK-NEXT: run 2 evaluate: where/region_assign1 !CHECK-LABEL: scheduling where in _QPonly_once -!CHECK-NEXT: unknown effect: %{{[0-9]+}} = llvm.intr.stacksave : !llvm.ptr +!CH

[llvm-branch-commits] [flang] [flang] optimize array function calls using hlfir.eval_in_mem (PR #118070)

2024-11-29 Thread Tom Eccles via llvm-branch-commits
@@ -24,6 +24,10 @@ namespace Fortran::lower { +struct LoweredResult { + std::variant result; +}; tblah wrote: nit: Could this be simplified to ```c++ using LoweredResult = std::variant result; ``` This way callers wouldn't have to add a `.result`. https:

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2024-11-21 Thread Tom Eccles via llvm-branch-commits
@@ -21,7 +21,7 @@ subroutine declare_mapper_1 type (my_type2):: t real :: x, y(nvals) !$omp declare mapper (my_type :: var) map (var, var%values (1:var%num_vals)) -!CHECK: not yet implemented: OpenMPDeclareMapperConstruct +!CHECK: not yet impleme

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2024-11-21 Thread Tom Eccles via llvm-branch-commits
@@ -2701,7 +2702,39 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable, semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, const parser::OpenMPDeclareMapperConstruct &declareMapperConstruct) { - TODO(converter.getC

[llvm-branch-commits] [flang] [flang][OpenMP] Apply modifier representation to semantic checks (PR #116658)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
@@ -3440,6 +3440,16 @@ struct OmpObject { WRAPPER_CLASS(OmpObjectList, std::list); +#define MODIFIER_BOILERPLATE(...) \ + struct Modifier { \ +using Variant = std::variant<__VA_ARGS__>; \ +UNION_CLASS_BOILERPLATE(Modifier); \ +CharBlock source; \ +Variant u;

[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Change clause modifier representation in parser (PR #116656)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. This is really nice. LGTM https://github.com/llvm/llvm-project/pull/116656 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

[llvm-branch-commits] [flang] [flang][OpenMP] Apply modifier representation to semantic checks (PR #116658)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
@@ -33,7 +33,7 @@ program main enddo !$omp end target parallel - !ERROR: The DEFAULTMAP clause requires a variable-category SCALAR in OpenMP v1.1, try -fopenmp-version=50 + !ERROR: A variable-category modifier is required tblah wrote: I'm worried that

[llvm-branch-commits] [flang] [flang][OpenMP] Apply modifier representation to semantic checks (PR #116658)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
@@ -3440,6 +3440,16 @@ struct OmpObject { WRAPPER_CLASS(OmpObjectList, std::list); +#define MODIFIER_BOILERPLATE(...) \ + struct Modifier { \ +using Variant = std::variant<__VA_ARGS__>; \ +UNION_CLASS_BOILERPLATE(Modifier); \ +CharBlock source; \ +Variant u;

[llvm-branch-commits] [flang] [flang][OpenMP] Apply modifier representation to semantic checks (PR #116658)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/116658 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang][OpenMP] Apply modifier representation to semantic checks (PR #116658)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Tentatively +1, but if you can please wait for Kiran to take a look as well. https://github.com/llvm/llvm-project/pull/116658 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org h

[llvm-branch-commits] [flang] [flang][OpenMP] Apply modifier representation to semantic checks (PR #116658)

2024-11-20 Thread Tom Eccles via llvm-branch-commits
@@ -33,7 +33,7 @@ program main enddo !$omp end target parallel - !ERROR: The DEFAULTMAP clause requires a variable-category SCALAR in OpenMP v1.1, try -fopenmp-version=50 + !ERROR: A variable-category modifier is required tblah wrote: Improving in a su

[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DOACROSS clause (PR #115397)

2024-11-08 Thread Tom Eccles via llvm-branch-commits
@@ -933,11 +934,19 @@ void OmpStructureChecker::CheckDistLinear( } } -void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &) { +void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &x) { if (llvm::omp::allSimdSet.test(GetContext().directive)) {

[llvm-branch-commits] [flang] [flang][OpenMP] Semantic checks for DOACROSS clause (PR #115397)

2024-11-08 Thread Tom Eccles via llvm-branch-commits
@@ -541,6 +541,7 @@ void OmpStructureChecker::Leave(const parser::OpenMPConstruct &) { } void OmpStructureChecker::Enter(const parser::OpenMPLoopConstruct &x) { + loopStack_.push_back(&x); tblah wrote: Is this needed for non-assertion builds? https://githu

[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Use new modifiers in DEPEND/GRAINSIZE/NUM_TASKS (PR #117917)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/117917 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang][OpenMP] Rename some `Type` members in OpenMP clauses (PR #117784)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/117784 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang] optimize array function calls using hlfir.eval_in_mem (PR #118070)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM with the one nit https://github.com/llvm/llvm-project/pull/118070 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bra

[llvm-branch-commits] [flang] [flang] optimize array function calls using hlfir.eval_in_mem (PR #118070)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
@@ -134,7 +134,7 @@ end function f !CHECK-NEXT: run 1 save: where/mask !CHECK-NEXT: run 2 evaluate: where/region_assign1 !CHECK-LABEL: scheduling where in _QPonly_once -!CHECK-NEXT: unknown effect: %{{[0-9]+}} = llvm.intr.stacksave : !llvm.ptr +!CH

[llvm-branch-commits] [flang] [flang][OpenMP] Use new modifiers in IF/LASTPRIVATE (PR #118128)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/118128 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang][OpenMP] Use new modifiers with AFFINITY/ALIGNED/DEVICE (PR #117786)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks https://github.com/llvm/llvm-project/pull/117786 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang][OpenMP] Use new modifiers in IF/LASTPRIVATE (PR #118128)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
@@ -16,13 +16,58 @@ #include "token-parsers.h" #include "type-parser-implementation.h" #include "flang/Parser/parse-tree.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Frontend/OpenMP/OMP.h" // OpenMP Dire

[llvm-branch-commits] [flang] [flang][OpenMP] Use new modifiers in IF/LASTPRIVATE (PR #118128)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, just some nit picks. https://github.com/llvm/llvm-project/pull/118128 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llv

[llvm-branch-commits] [flang] [flang][OpenMP] Use new modifiers in IF/LASTPRIVATE (PR #118128)

2024-12-02 Thread Tom Eccles via llvm-branch-commits
@@ -16,13 +16,58 @@ #include "token-parsers.h" #include "type-parser-implementation.h" #include "flang/Parser/parse-tree.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Frontend/OpenMP/OMP.h" // OpenMP Dire

[llvm-branch-commits] [flang] [flang] Introduce HLFIR lowerings to omp.workshare_loop_nest (PR #104748)

2024-11-14 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/104748 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [flang] Lower omp.workshare to other omp constructs (PR #101446)

2024-11-14 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Looks great to me and this passes the testsuites I have available. Thanks again for all of your work on this. https://github.com/llvm/llvm-project/pull/101446 ___ llvm-branch-commits mailing list ll

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2024-11-25 Thread Tom Eccles via llvm-branch-commits
@@ -2701,7 +2701,42 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable, semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, const parser::OpenMPDeclareMapperConstruct &declareMapperConstruct) { - TODO(converter.getC

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2024-11-25 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/117046 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2025-02-03 Thread Tom Eccles via llvm-branch-commits
@@ -2612,7 +2612,54 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable, semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, const parser::OpenMPDeclareMapperConstruct &declareMapperConstruct) { - TODO(converter.getC

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2025-02-03 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/117046 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2025-02-03 Thread Tom Eccles via llvm-branch-commits
@@ -2612,7 +2612,54 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable, semantics::SemanticsContext &semaCtx, lower::pft::Evaluation &eval, const parser::OpenMPDeclareMapperConstruct &declareMapperConstruct) { - TODO(converter.getC

[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP Declare Mapper directive (PR #117046)

2025-02-03 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: I have some minor suggestions on the code. Please wait for review from somebody with more familiarity with omp target things, and this is conditional on the design of the MLIR operation being approved. https://github.com/llvm/llvm-project/pull/117046 ___

[llvm-branch-commits] [flang] release/20.x: [flang][runtime] Make sure to link libexecinfo if it exists (#125344) (PR #125515)

2025-02-03 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. https://github.com/llvm/llvm-project/pull/125515 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [mlir] WIP: [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-03 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/125307 >From afa9026eefb6c9cd613ed021a92e159f93c3667c Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 24 Jan 2025 17:32:41 + Subject: [PATCH 1/2] [mlir][OpenMP] Pack task private variables into a heap-allocated

[llvm-branch-commits] [mlir] WIP: [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/125307 >From afa9026eefb6c9cd613ed021a92e159f93c3667c Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 24 Jan 2025 17:32:41 + Subject: [PATCH 1/3] [mlir][OpenMP] Pack task private variables into a heap-allocated

[llvm-branch-commits] [mlir] WIP: [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah 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

[llvm-branch-commits] [mlir] WIP: [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-04 Thread Tom Eccles via llvm-branch-commits
tblah wrote: This should now be ready for review. 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

[llvm-branch-commits] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah 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

[llvm-branch-commits] [mlir] WIP: [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah ready_for_review 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

[llvm-branch-commits] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-05 Thread Tom Eccles via llvm-branch-commits
@@ -1730,6 +1730,126 @@ buildDependData(std::optional dependKinds, OperandRange dependVars, } } +static bool privatizerReadsSourceVariable(omp::PrivateClauseOp &priv) { + if (priv.getDataSharingType() == omp::DataSharingClauseType::FirstPrivate) +return true; + + Regi

[llvm-branch-commits] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-05 Thread Tom Eccles via llvm-branch-commits
@@ -1730,6 +1730,126 @@ buildDependData(std::optional dependKinds, OperandRange dependVars, } } +static bool privatizerReadsSourceVariable(omp::PrivateClauseOp &priv) { + if (priv.getDataSharingType() == omp::DataSharingClauseType::FirstPrivate) +return true; + + Regi

[llvm-branch-commits] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-05 Thread Tom Eccles via llvm-branch-commits
@@ -1796,36 +1918,110 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase &builder, // Allocate and initialize private variables // TODO: package private variables up in a structure builder.SetInsertPoint(initBlock->getTerminator()); - for (auto [privDecl, mlirP

[llvm-branch-commits] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-05 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah 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

[llvm-branch-commits] [flang] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-05 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/125307 >From afa9026eefb6c9cd613ed021a92e159f93c3667c Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 24 Jan 2025 17:32:41 + Subject: [PATCH 1/8] [mlir][OpenMP] Pack task private variables into a heap-allocated

[llvm-branch-commits] [flang] [flang][Lower][OpenMP] Don't read moldarg for static sized array (PR #125901)

2025-02-06 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/125901 >From 8a7e449cfa357e18ba094cc61d14bf481668ddcd Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 5 Feb 2025 17:29:42 + Subject: [PATCH] [flang][Lower][OpenMP] Don't read moldarg for static sized array Thi

[llvm-branch-commits] [flang] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-06 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/125307 >From 06831df6909ff246ccd541e4f4c39fd47fd993a4 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 24 Jan 2025 17:32:41 + Subject: [PATCH 01/12] [mlir][OpenMP] Pack task private variables into a heap-allocat

[llvm-branch-commits] [flang] [mlir] [mlir][OpenMP] Pack task private variables into a heap-allocated context struct (PR #125307)

2025-02-05 Thread Tom Eccles via llvm-branch-commits
@@ -1796,36 +1918,110 @@ convertOmpTaskOp(omp::TaskOp taskOp, llvm::IRBuilderBase &builder, // Allocate and initialize private variables // TODO: package private variables up in a structure builder.SetInsertPoint(initBlock->getTerminator()); - for (auto [privDecl, mlirP

<    1   2   3   4   >