[llvm-branch-commits] [mlir] [MLIR][OpenMP] Clause-based OpenMP operation definition (PR #92523)

2024-06-06 Thread Tom Eccles via llvm-branch-commits
@@ -315,38 +266,17 @@ def SectionsOp : OpenMP_Op<"sections", [AttrSizedOperandSegments, into the final value, which is available in the accumulator after all the sections complete. -The $allocators_vars and $allocate_vars parameters are a variadic list of values

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Clause-based OpenMP operation definition (PR #92523)

2024-06-06 Thread Tom Eccles via llvm-branch-commits
@@ -920,6 +663,9 @@ def TaskloopOp : OpenMP_Op<"taskloop", [AttrSizedOperandSegments, specifies how to combine the values from each iteration into the final value, which is available in the accumulator after the loop completes. +The optional `byref` attribute cont

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Clause-based OpenMP operation definition (PR #92523)

2024-06-07 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > @tblah thanks for giving this a look. Basically the issue here with the > reduction clause is that its description is currently different for each > operation that accepts it. > It would be great to agree on a generic description for that clause that > would work for all ops,

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Clause-based OpenMP operation definition (PR #92523)

2024-06-07 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, but please wait for another reviewer https://github.com/llvm/llvm-project/pull/92523 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Clause-based OpenMP operation definition (PR #92523)

2024-06-07 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/92523 ___ 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] Clause-based OpenMP operation definition (PR #92523)

2024-06-20 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > I guess fixing byref is on me (#92244). Unfortunately I can't work on this > immediately so I won't hold up this PR for it. @skatrak does https://github.com/llvm/llvm-project/pull/96215 cover everything you need? https://github.com/llvm/llvm-project/pull/92523 _

[llvm-branch-commits] [flang] [Flang][OpenMP] Update flang with changes to the OpenMP dialect (PR #92524)

2024-06-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/92524 ___ 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][OpenMP] NFC: Share DataSharingProcessor creation logic for all loop directives (PR #97565)

2024-07-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/97565 ___ 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][OpenMP] Refactor loop-related lowering for composite support (PR #97566)

2024-07-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/97566 ___ 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] Refactor loop-related lowering for composite support (PR #97566)

2024-07-04 Thread Tom Eccles via llvm-branch-commits
@@ -518,8 +518,8 @@ struct OpWithBodyGenInfo { } OpWithBodyGenInfo & - setReductions(llvm::SmallVectorImpl *value1, -llvm::SmallVectorImpl *value2) { + setReductions(llvm::ArrayRef *value1, +llvm::ArrayRef *value2) { tblah

[llvm-branch-commits] [flang] [Flang][OpenMP] Refactor loop-related lowering for composite support (PR #97566)

2024-07-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: This looks good overall. Do you expect there to be a lot more wrapper operations in the near future? If so, they look like there is a common pattern that could be further abstracted. Something like ```c++ template static OP genWrapperOp(..., llvm::ArrayRef

[llvm-branch-commits] [flang] [Flang][OpenMP] Refactor loop-related lowering for composite support (PR #97566)

2024-07-04 Thread Tom Eccles via llvm-branch-commits
@@ -1492,7 +1466,7 @@ genParallelOp(lower::AbstractConverter &converter, lower::SymMap &symTable, firOpBuilder.createBlock(®ion, /*insertPt=*/{}, allRegionArgTypes, allRegionArgLocs); -llvm::SmallVector allSymbols = reductionSyms; +llv

[llvm-branch-commits] [flang] [Flang][OpenMP] Prevent allocas from being inserted into loop wrappers (PR #97563)

2024-07-04 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Code changes look good. I would prefer to see a lit test for this code path. It is good enough if this is used by a test added later in your PR stack. Otherwise, please could you add a lit test which hits this condition so that we can catch

[llvm-branch-commits] [flang] [Flang][OpenMP] Add lowering support for DISTRIBUTE SIMD (PR #97819)

2024-07-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/97819 ___ 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] [mlir] [Flang][OpenMP] Add lowering support for DO SIMD (PR #97718)

2024-07-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/97718 ___ 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] Add missing clauses to OpenMP op definitions (PR #99507)

2024-07-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: I think it would be best to add errors for these unsupported clauses to the OpenMPToLLVMIR translation, so that clauses in MLIR are not silently ignored. https://github.com/llvm/llvm-project/pull/99507 ___ llvm-bran

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add missing clauses to OpenMP op definitions (PR #99507)

2024-07-22 Thread Tom Eccles via llvm-branch-commits
@@ -238,9 +237,9 @@ def SectionOp : OpenMP_Op<"section", [HasParent<"SectionsOp">], def SectionsOp : OpenMP_Op<"sections", traits = [ AttrSizedOperandSegments ], clauses = [ -// TODO: Complete clause list (private). // TODO: Sort clauses alphabetically.

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add missing clauses to OpenMP op definitions (PR #99507)

2024-07-22 Thread Tom Eccles via llvm-branch-commits
@@ -432,9 +439,10 @@ def SimdOp : OpenMP_Op<"simd", traits = [ AttrSizedOperandSegments, DeclareOpInterfaceMethods, RecursiveMemoryEffects, SingleBlock ], clauses = [ -// TODO: Complete clause list (linear, private, reduction). +// TODO: Complete clause list (

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add missing clauses to OpenMP op definitions (PR #99507)

2024-07-22 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/99507 ___ 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] Create `LoopRelatedClause` (PR #99506)

2024-07-23 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/99506 ___ 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][OpenMP] Add frontend support for -fopenmp-targets (PR #100155)

2024-07-24 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/100155 ___ 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] release/19.x: [flang][debug] Set scope of internal functions correctly. (#99531) (PR #100727)

2024-07-26 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. https://github.com/llvm/llvm-project/pull/100727 ___ 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] NFC: Sort clauses alphabetically (2/2) (PR #101194)

2024-07-31 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM, thanks again! https://github.com/llvm/llvm-project/pull/101194 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branc

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

2024-08-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-01 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-01 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: Thank you for your work so far. This is a great start. What is the plan for transforming do loops generated by lowering (e.g. that do not become hlfir.elemental operations and are not generated by hlfir bufferization)? https://github.com/llvm/llvm-project/p

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

2024-08-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-01 Thread Tom Eccles via llvm-branch-commits
@@ -344,6 +345,7 @@ inline void createHLFIRToFIRPassPipeline( pm.addPass(hlfir::createLowerHLFIRIntrinsics()); pm.addPass(hlfir::createBufferizeHLFIR()); pm.addPass(hlfir::createConvertHLFIRtoFIR()); + pm.addPass(flangomp::createLowerWorkshare()); tblah

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

2024-08-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,18 @@ +//===-- Passes.td - HLFIR pass definition file -*- 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: Apa

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

2024-08-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-01 Thread Tom Eccles via llvm-branch-commits
@@ -2,3 +2,4 @@ add_subdirectory(CodeGen) add_subdirectory(Dialect) add_subdirectory(HLFIR) add_subdirectory(Transforms) +add_subdirectory(OpenMP) tblah wrote: There are some other OpenMP passes already in `flang/lib/Optimizer/Transforms/OMP*.cpp`. I prefer

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

2024-08-01 Thread Tom Eccles via llvm-branch-commits
@@ -792,7 +793,8 @@ struct ElementalOpConversion // Generate a loop nest looping around the fir.elemental shape and clone // fir.elemental region inside the inner loop. hlfir::LoopNest loopNest = -hlfir::genLoopNest(loc, builder, extents, !elemental.isOrdere

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

2024-08-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-01 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-05 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,259 @@ +//===- 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-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah commented: Thank you for all of the updates! > So the LowerWorksharePass that I have implemented here is tasked with > parallelizing the loops nested in workshare_loop_wrapper and both the > Fortran->mlir frontend and the hlfir lowering passes would be responsible for

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

2024-08-08 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-08 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,399 @@ +//===- 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-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/102524 The intention of this change is to ensure that allocas end up in the entry block not spread out amongst complex reduction variable initialization code. The tests we have are quite minimized for readability and ma

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

2024-08-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/102525 I removed the `*-hlfir*` tests because they are duplicate now that the other tests have been updated to use the HLFIR lowering. 3/3 Part 1: https://github.com/llvm/llvm-project/pull/102522 Part 2: https://github.

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

2024-08-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/102524 ___ 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] Convert reduction alloc region to LLVMIR (PR #102524)

2024-08-20 Thread Tom Eccles via llvm-branch-commits
tblah wrote: ping for review https://github.com/llvm/llvm-project/pull/102524 ___ 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 reduction alloc region (PR #102525)

2024-08-20 Thread Tom Eccles via llvm-branch-commits
tblah wrote: ping for review https://github.com/llvm/llvm-project/pull/102525 ___ 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] Convert reduction alloc region to LLVMIR (PR #102524)

2024-08-21 Thread Tom Eccles via llvm-branch-commits
@@ -594,45 +594,85 @@ convertOmpOrderedRegion(Operation &opInst, llvm::IRBuilderBase &builder, /// Allocate space for privatized reduction variables. template -static void allocByValReductionVars( -T loop, ArrayRef reductionArgs, llvm::IRBuilderBase &builder, -LLVM:

[llvm-branch-commits] [mlir] [MLIR][omp] Add omp.workshare op (PR #101443)

2024-08-21 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM. Thanks for the updates https://github.com/llvm/llvm-project/pull/101443 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/l

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

2024-08-21 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > Should we have a `-use-experimental-workshare` or similar flag to facilitate > some temporary in-tree development as this may require more moving pieces? A flag like that sounds appropriate yes. The current code changes look good. https://github.com/llvm/llvm-project/pull/101444

[llvm-branch-commits] [mlir] [flang] [mlir][flang][openmp] Rework wsloop reduction operations (PR #80019)

2024-02-05 Thread Tom Eccles via llvm-branch-commits
tblah wrote: Please could you update the documentation for reductions on line 442 - I presume we don't want to encourage `omp.reduction` operations anymore https://github.com/llvm/llvm-project/pull/80019 ___ llvm-bra

[llvm-branch-commits] [mlir] [flang] [mlir][flang][openmp] Rework wsloop reduction operations (PR #80019)

2024-02-05 Thread Tom Eccles via llvm-branch-commits
@@ -398,11 +400,39 @@ struct ParallelOpLowering : public OpRewritePattern { // Replace the reduction operations contained in this loop. Must be done // here rather than in a separate pattern to have access to the list of // reduction variables. +unsigned int re

[llvm-branch-commits] [mlir] [flang] [mlir][flang][openmp] Rework wsloop reduction operations (PR #80019)

2024-02-05 Thread Tom Eccles via llvm-branch-commits
@@ -398,11 +400,39 @@ struct ParallelOpLowering : public OpRewritePattern { // Replace the reduction operations contained in this loop. Must be done // here rather than in a separate pattern to have access to the list of // reduction variables. +unsigned int re

[llvm-branch-commits] [flang] [mlir] [mlir][flang][openmp] Rework wsloop reduction operations (PR #80019)

2024-02-08 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks for the update! https://github.com/llvm/llvm-project/pull/80019 ___ 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] [llvm] [mlir] [flang][OpenMP][OMPIRBuilder][mlir] Optionally pass reduction vars by ref (PR #84304)

2024-03-07 Thread Tom Eccles via llvm-branch-commits
tblah wrote: co-authored with @Leporacanthicus (github seems to have taken the tag out of the commit message but shows it in the UI) https://github.com/llvm/llvm-project/pull/84304 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.o

[llvm-branch-commits] [flang] [flang][TBAABuilder] not all loads and stores are inside of functions (PR #84305)

2024-03-07 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84305 TBAA builder assumed that all loads/stores are inside of functions and hit an assertion once it found loads and stores inside of an omp::ReductionDeclareOp. For now just don't add TBAA tags to those loads and store

[llvm-branch-commits] [flang] [flang][TBAABuilder] not all loads and stores are inside of functions (PR #84305)

2024-03-07 Thread Tom Eccles via llvm-branch-commits
tblah wrote: Next PR in the series https://github.com/llvm/llvm-project/pull/84304 https://github.com/llvm/llvm-project/pull/84305 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/l

[llvm-branch-commits] [flang] [flang] support fir.alloca operations inside of omp reduction ops (PR #84952)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84952 Advise to place the alloca at the start of the first block of whichever region (init or combiner) we are currently inside. It probably isn't safe to put an alloca inside of a combiner region because this will be e

[llvm-branch-commits] [flang] [flang] run CFG conversion on omp reduction declare ops (PR #84953)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84953 Most FIR passes only look for FIR operations inside of functions (either because they run only on func.func or they run on the module but iterate over functions internally). But there can also be FIR operations ins

[llvm-branch-commits] [flang] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84954 OpenMP reduction declare operations can contain FIR code which needs to be lowered to LLVM. With array reductions, these regions can contain more complicated operations which need PreCGRewriting. A similar extra ca

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84955 It looks like the mappings for call instructions were forgotten here. This fixes a bug in OpenMP when in-lining a region containing call operations multiple times. OpenMP array reductions 4/6 >From c62b31262bc619

[llvm-branch-commits] [flang] [flang][NFC] move extractSequenceType helper out of OpenACC to share code (PR #84957)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84957 Moving extractSequenceType to FIRType.h so that this can also be used from OpenMP. OpenMP array reductions 5/6 >From 2ff12fa0a580cb060f208d173d9af72bfa49d3b2 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 1

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/84958 This has been tested with arrays with compile-time constant bounds. Allocatable arrays and arrays with non-constant bounds are not yet supported. User-defined reduction functions are also not yet supported. The de

[llvm-branch-commits] [flang] [flang] support fir.alloca operations inside of omp reduction ops (PR #84952)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/84952 ___ 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] run CFG conversion on omp reduction declare ops (PR #84953)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/84953 ___ 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][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/84954 ___ 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][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/84955 ___ 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][NFC] move extractSequenceType helper out of OpenACC to share code (PR #84957)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/84957 ___ 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] lower simple array reductions (PR #84958)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/84958 ___ 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] Convert unique clauses in ClauseProcessor (PR #81622)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/81622 ___ 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] Convert repeatable clauses (except Map) in ClauseProc… (PR #81623)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
@@ -87,50 +87,44 @@ getSimdModifier(const omp::clause::Schedule &clause) { static void genAllocateClause(Fortran::lower::AbstractConverter &converter, - const Fortran::parser::OmpAllocateClause &ompAllocateClause, + const omp::clause::Allocate

[llvm-branch-commits] [flang] [flang][OpenMP] Convert repeatable clauses (except Map) in ClauseProc… (PR #81623)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
@@ -181,45 +172,41 @@ genDependKindAttr(fir::FirOpBuilder &firOpBuilder, pbKind); } -static mlir::Value getIfClauseOperand( -Fortran::lower::AbstractConverter &converter, -const Fortran::parser::OmpClause::If *ifClause, -

[llvm-branch-commits] [flang] [flang][OpenMP] Convert repeatable clauses (except Map) in ClauseProc… (PR #81623)

2024-03-12 Thread Tom Eccles via llvm-branch-commits
@@ -181,45 +172,41 @@ genDependKindAttr(fir::FirOpBuilder &firOpBuilder, pbKind); } -static mlir::Value getIfClauseOperand( -Fortran::lower::AbstractConverter &converter, -const Fortran::parser::OmpClause::If *ifClause, -

[llvm-branch-commits] [flang] [flang] support fir.alloca operations inside of omp reduction ops (PR #84952)

2024-03-13 Thread Tom Eccles via llvm-branch-commits
@@ -410,8 +410,15 @@ class FIROpConversion : public mlir::ConvertOpToLLVMPattern { mlir::ConversionPatternRewriter &rewriter) const { auto thisPt = rewriter.saveInsertionPoint(); mlir::Operation *parentOp = rewriter.getInsertionBlock()->getParentOp(); -mlir::

[llvm-branch-commits] [flang] [flang][OpenMP] Convert repeatable clauses (except Map) in ClauseProc… (PR #81623)

2024-03-13 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. Thanks for explaining. LGTM https://github.com/llvm/llvm-project/pull/81623 ___ 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] Convert processTODO and remove unused objects (PR #81627)

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

[llvm-branch-commits] [flang] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-14 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84954 >From f951d16cf6cb1ab221f47ca2e712020b9af0af87 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 1 Mar 2024 16:59:09 + Subject: [PATCH 1/3] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops Ope

[llvm-branch-commits] [flang] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-14 Thread Tom Eccles via llvm-branch-commits
@@ -319,6 +320,10 @@ class CodeGenRewrite : public fir::impl::CodeGenRewriteBase { runOn(func, func.getBody()); for (auto global : mod.getOps()) runOn(global, global.getRegion()); +for (auto omp : mod.getOps()) { tblah wrote: Good idea. Th

[llvm-branch-commits] [flang] [flang] run CFG conversion on omp reduction declare ops (PR #84953)

2024-03-14 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84953 >From 192da3c05fd8c0759f280e0895ffc2f09b2203e4 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 15 Feb 2024 12:12:29 + Subject: [PATCH 1/2] [flang] run CFG conversion on omp reduction declare ops Most FIR p

[llvm-branch-commits] [flang] [flang] run CFG conversion on omp reduction declare ops (PR #84953)

2024-03-14 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > Wouldn't it be cleaner to expose the patterns via a > `populateFirCfgConversionPatterns` function and reuse it in you extra pass > instead of making two pass from the initial file? > > We did this recently for the FirToLLVM patterns. #83492 Thanks for taking a look at this. I h

[llvm-branch-commits] [flang] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-14 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84954 >From f951d16cf6cb1ab221f47ca2e712020b9af0af87 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 1 Mar 2024 16:59:09 + Subject: [PATCH 1/4] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops Ope

[llvm-branch-commits] [flang] [flang] run CFG conversion on omp reduction declare ops (PR #84953)

2024-03-15 Thread Tom Eccles via llvm-branch-commits
tblah wrote: > Wouldn't applying the patterns on the module in a single pass work here as > well? Yes that would work but we would loose parallelism. I wanted to keep that because there was talk in the past about breaking up the existing Module passes so that different functions (or other con

[llvm-branch-commits] [flang] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-15 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84954 >From f951d16cf6cb1ab221f47ca2e712020b9af0af87 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Fri, 1 Mar 2024 16:59:09 + Subject: [PATCH 1/5] [flang][CodeGen] Run PreCGRewrite on omp reduction declare ops Ope

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-15 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84955 >From c62b31262bc619145866a304e10925a35462f5bf Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 21 Feb 2024 14:22:39 + Subject: [PATCH 1/2] [mlir][LLVM] erase call mappings in forgetMapping() It looks like

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-15 Thread Tom Eccles via llvm-branch-commits
@@ -390,15 +559,35 @@ void ReductionProcessor::addReductionDecl( // initial pass to collect all recuction vars so we can figure out if this // should happen byref + fir::FirOpBuilder &builder = converter.getFirOpBuilder(); for (const Fortran::parser::OmpObject &ompObje

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
@@ -283,13 +316,166 @@ mlir::Value ReductionProcessor::createScalarCombiner( return reductionOp; } +/// Create reduction combiner region for reduction variables which are boxed +/// arrays +static void genBoxCombiner(fir::FirOpBuilder &builder, mlir::Location loc, +

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
@@ -0,0 +1,74 @@ +! RUN: bbc -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s +! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s + +program reduce +integer, dimension(3) :: i = 0 + +!$omp parallel reduction(+:i) +i(1) = 1 +i(2) = 2 +i(3) = 3 tblah

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
@@ -92,10 +93,42 @@ std::string ReductionProcessor::getReductionName(llvm::StringRef name, if (isByRef) byrefAddition = "_byref"; - return (llvm::Twine(name) + - (ty.isIntOrIndex() ? llvm::Twine("_i_") : llvm::Twine("_f_")) + - llvm::Twine(ty.getIntOr

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84958 >From bd668cd95d95d1e5b9c8436875c14878c98902ff Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Mon, 12 Feb 2024 14:03:00 + Subject: [PATCH 1/4] [flang][OpenMP] lower simple array reductions This has been tested

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84958 >From bd668cd95d95d1e5b9c8436875c14878c98902ff Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Mon, 12 Feb 2024 14:03:00 + Subject: [PATCH 1/5] [flang][OpenMP] lower simple array reductions This has been tested

[llvm-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
@@ -92,10 +93,42 @@ std::string ReductionProcessor::getReductionName(llvm::StringRef name, if (isByRef) byrefAddition = "_byref"; - return (llvm::Twine(name) + - (ty.isIntOrIndex() ? llvm::Twine("_i_") : llvm::Twine("_f_")) + - llvm::Twine(ty.getIntOr

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/84955 >From 0b2f5fee61d170b0a2197fd5da92f0e84b3b14f4 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Wed, 21 Feb 2024 14:22:39 + Subject: [PATCH 1/3] [mlir][LLVM] erase call mappings in forgetMapping() It looks like

[llvm-branch-commits] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-18 Thread Tom Eccles via llvm-branch-commits
tblah wrote: Sorry about the force push. Github wasn't showing the new commit (02550e1). It is just a rebase onto the target branch. https://github.com/llvm/llvm-project/pull/84955 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.or

[llvm-branch-commits] [mlir] [mlir][OpenMP] map argument to reduction initialization region (PR #86979)

2024-03-28 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/86979 The argument to the initialization region of reduction declarations was never mapped. This meant that if this argument was accessed inside the initialization region, that mlir operation would be translated to an ll

[llvm-branch-commits] [mlir] [mlir][OpenMP] map argument to reduction initialization region (PR #86979)

2024-03-28 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/86979 ___ 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] lower reductions of assumed shape arrays (PR #86982)

2024-03-28 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah created https://github.com/llvm/llvm-project/pull/86982 Patch 1: https://github.com/llvm/llvm-project/pull/86978 Patch 2: https://github.com/llvm/llvm-project/pull/86979 >From 9f68c844b6f4c4a52002cd9d90cd158b10e64bf2 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue,

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update op verifiers dependent on omp.wsloop (2/5) (PR #89211)

2024-04-18 Thread Tom Eccles via llvm-branch-commits
@@ -1977,9 +1977,10 @@ LogicalResult OrderedRegionOp::verify() { if (getSimd()) return failure(); - if (auto container = (*this)->getParentOfType()) { -if (!container.getOrderedValAttr() || -container.getOrderedValAttr().getInt() != 0) + if (auto loopOp = d

[llvm-branch-commits] [mlir] [MLIR][SCF] Update scf.parallel lowering to OpenMP (3/5) (PR #89212)

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

[llvm-branch-commits] [mlir] [MLIR][OpenMP] Update omp.wsloop translation to LLVM IR (4/5) (PR #89214)

2024-04-18 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/89214 ___ 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] Update op verifiers dependent on omp.wsloop (2/5) (PR #89211)

2024-04-23 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LGTM. I'm sorry this fell off my radar https://github.com/llvm/llvm-project/pull/89211 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[llvm-branch-commits] [flang] [flang][OpenMP] Implement getIterationVariableSymbol helper function,… (PR #90087)

2024-04-26 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LG https://github.com/llvm/llvm-project/pull/90087 ___ 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] Pass symTable to all genXYZ functions, NFC (PR #90090)

2024-04-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/90090 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit

[llvm-branch-commits] [flang] [flang][OpenMP] Don't pass clauses to op-generating functions anymore (PR #90108)

2024-04-26 Thread Tom Eccles via llvm-branch-commits
https://github.com/tblah approved this pull request. LG. Thanks for the cleanup https://github.com/llvm/llvm-project/pull/90108 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

  1   2   3   4   >