[llvm-branch-commits] [mlir] [MLIR][OpenMP] Support clause-based representation of operations (PR #92519)

2024-05-17 Thread Kiran Chandramohan via llvm-branch-commits
kiranchandramohan wrote: @skatrak Could you copy the summary of the patch and create an RFC? https://github.com/llvm/llvm-project/pull/92519 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Pass symTable to all genXYZ functions, NFC (PR #90090)

2024-04-25 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. https://github.com/llvm/llvm-project/pull/90090 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [llvm] [flang][OpenMP] Decompose compound construccts, do recursive lowering (PR #90098)

2024-04-25 Thread Kiran Chandramohan via llvm-branch-commits
kiranchandramohan wrote: Is it possible to add tests for this? Can we move the decomposition logic into a separate file? https://github.com/llvm/llvm-project/pull/90098 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

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

2024-04-25 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. https://github.com/llvm/llvm-project/pull/90087 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Support tasks' implicit firstprivate DSA (PR #85989)

2024-04-25 Thread Kiran Chandramohan via llvm-branch-commits
@@ -2012,34 +2012,87 @@ void OmpAttributeVisitor::Post(const parser::Name ) { } } } -std::vector defaultDSASymbols; + +// Implicitly determined DSAs +// OMP 5.2 5.1.1 - Variables Referenced in a Construct +Symbol *lastDeclSymbol = nullptr; +

[llvm-branch-commits] [flang] [flang][OpenMP] Support tasks' implicit firstprivate DSA (PR #85989)

2024-04-21 Thread Kiran Chandramohan via llvm-branch-commits
@@ -2012,34 +2012,87 @@ void OmpAttributeVisitor::Post(const parser::Name ) { } } } -std::vector defaultDSASymbols; + +// Implicitly determined DSAs +// OMP 5.2 5.1.1 - Variables Referenced in a Construct +Symbol *lastDeclSymbol = nullptr; +

[llvm-branch-commits] [flang] [flang][OpenMP] Support tasks' implicit firstprivate DSA (PR #85989)

2024-04-21 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. Nice work. https://github.com/llvm/llvm-project/pull/85989 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Support tasks' implicit firstprivate DSA (PR #85989)

2024-04-21 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan edited https://github.com/llvm/llvm-project/pull/85989 ___ 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] NFC: Remove LoopControl parsing/printing code (PR #88909)

2024-04-16 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. https://github.com/llvm/llvm-project/pull/88909 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Support tasks' implicit firstprivate DSA (PR #85989)

2024-03-24 Thread Kiran Chandramohan via llvm-branch-commits
kiranchandramohan wrote: I am away this week, will come back to this next week. https://github.com/llvm/llvm-project/pull/85989 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] simplify getReductionName (PR #85666)

2024-03-18 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. > The idea was suggested by Kiran: > https://github.com/llvm/llvm-project/pull/84958#discussion_r1527604388 It was implement by @clementval and recommended by him in other patches. I was just forwarding the suggestion. Thanks

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

2024-03-18 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan 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] lower simple array reductions (PR #84958)

2024-03-18 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. For compile-time constant bounds we should switch to a non-box version sometime later. Thanks for the changes. https://github.com/llvm/llvm-project/pull/84958 ___ llvm-branch-commits

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

2024-03-18 Thread Kiran Chandramohan via llvm-branch-commits
@@ -1108,6 +1108,35 @@ hlfir::createTempFromMold(mlir::Location loc, fir::FirOpBuilder , return {hlfir::Entity{declareOp.getBase()}, isHeapAlloc}; } +hlfir::Entity hlfir::createStackTempFromMold(mlir::Location loc, kiranchandramohan wrote: @ergawy FYI:

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

2024-03-18 Thread Kiran Chandramohan 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 , mlir::Location loc, +

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

2024-03-18 Thread Kiran Chandramohan 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-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-18 Thread Kiran Chandramohan 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

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
@@ -465,8 +642,8 @@ void ReductionProcessor::addReductionDecl( if (auto declOp = symVal.getDefiningOp()) symVal = declOp.getBase(); auto redType = symVal.getType().cast(); -assert(redType.getEleTy().isIntOrIndexOrFloat() && -

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

2024-03-17 Thread Kiran Chandramohan 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-branch-commits] [flang] [flang][OpenMP] lower simple array reductions (PR #84958)

2024-03-17 Thread Kiran Chandramohan 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 , mlir::Location loc, +

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

2024-03-17 Thread Kiran Chandramohan 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

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan commented: Nice work. Have a few minor comments. https://github.com/llvm/llvm-project/pull/84958 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

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

2024-03-17 Thread Kiran Chandramohan 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 , mlir::Location loc, +

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan 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] [mlir] [mlir][LLVM] erase call mappings in forgetMapping() (PR #84955)

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
@@ -0,0 +1,47 @@ +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s + +// Test that we don't crash when there is a call operation in the combiner + +omp.reduction.declare @add_f32 : f32 +init { +^bb0(%arg: f32): + %0 = llvm.mlir.constant(0.0 : f32) : f32 + omp.yield (%0

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan commented: Some minor comments about the test. https://github.com/llvm/llvm-project/pull/84955 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
@@ -0,0 +1,47 @@ +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s + +// Test that we don't crash when there is a call operation in the combiner + +omp.reduction.declare @add_f32 : f32 +init { +^bb0(%arg: f32): + %0 = llvm.mlir.constant(0.0 : f32) : f32 + omp.yield (%0

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
@@ -0,0 +1,47 @@ +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s + +// Test that we don't crash when there is a call operation in the combiner + +omp.reduction.declare @add_f32 : f32 +init { +^bb0(%arg: f32): + %0 = llvm.mlir.constant(0.0 : f32) : f32 + omp.yield (%0

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

2024-03-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan 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][CodeGen] Run PreCGRewrite on omp reduction declare ops (PR #84954)

2024-03-14 Thread Kiran Chandramohan via llvm-branch-commits
@@ -18,6 +18,7 @@ #include "flang/Optimizer/Dialect/FIROps.h" #include "flang/Optimizer/Dialect/FIRType.h" #include "flang/Optimizer/Dialect/Support/FIRContext.h" +#include "mlir/Dialect/OpenMP/OpenMPDialect.h" kiranchandramohan wrote: The header is not

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

2024-03-14 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. Please wait for @clementval. https://github.com/llvm/llvm-project/pull/84954 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

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

2024-03-13 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. Can we add a test? https://github.com/llvm/llvm-project/pull/84952 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

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

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

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

2024-03-12 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LGTM. Please wait a day incase others have comments. https://github.com/llvm/llvm-project/pull/84955 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Convert DataSharingProcessor to omp::Clause (PR #81629)

2024-03-05 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. https://github.com/llvm/llvm-project/pull/81629 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Convert unique clauses in ClauseProcessor (PR #81622)

2024-03-04 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. Mostly mechanical changes. LGTM. Please wait for @skatrak https://github.com/llvm/llvm-project/pull/81622 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [flang][OpenMP] Convert DataSharingProcessor to omp::Clause (PR #81629)

2024-03-04 Thread Kiran Chandramohan via llvm-branch-commits
@@ -135,138 +133,135 @@ void DataSharingProcessor::insertBarrier() { void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) { bool cmpCreated = false; mlir::OpBuilder::InsertPoint localInsPt = firOpBuilder.saveInsertionPoint(); - for (const

[llvm-branch-commits] [llvm] release/18.x: [AArch64][GlobalISel] Fail legalization for unknown libcalls. (#81873) (PR #82103)

2024-02-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. https://github.com/llvm/llvm-project/pull/82103 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

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

2024-02-05 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan ready_for_review 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-branch-commits

[llvm-branch-commits] [mlir] [llvm] [OpenMPIRBuilder][MLIR] Pass target-cpu and target-features to outlined functions (PR #80283)

2024-02-01 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. https://github.com/llvm/llvm-project/pull/80283 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [flang] [mlir] [Flang][Lower] Attach target_cpu and target_features attributes to MLIR functions (PR #78289)

2024-01-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan edited https://github.com/llvm/llvm-project/pull/78289 ___ 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] [flang] [Flang][Lower] Attach target_cpu and target_features attributes to MLIR functions (PR #78289)

2024-01-17 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LG. Please wait a day before you merge to allow time for other reviewers. https://github.com/llvm/llvm-project/pull/78289 ___ llvm-branch-commits mailing list

[llvm-branch-commits] [flang] [mlir] [Flang][Lower] Attach target_cpu and target_features attributes to MLIR functions (PR #78289)

2024-01-17 Thread Kiran Chandramohan via llvm-branch-commits
@@ -4290,6 +4291,18 @@ class FirConverter : public Fortran::lower::AbstractConverter { assert(blockId == 0 && "invalid blockId"); assert(activeConstructStack.empty() && "invalid construct stack state"); +// Set target_cpu and target_features attributes to be

[llvm-branch-commits] [flang] [mlir] [Flang][MLIR][OpenMP] Use function-attached target attributes for OpenMP lowering (PR #78291)

2024-01-16 Thread Kiran Chandramohan via llvm-branch-commits
https://github.com/kiranchandramohan approved this pull request. LGTM. Please wait for @DominikAdamski Not for this patch, but would we need to add this info for all outlined functions? https://github.com/llvm/llvm-project/pull/78291 ___

[llvm-branch-commits] [flang] [Flang][Lower] Attach target_cpu and target_features attributes to MLIR functions (PR #78289)

2024-01-16 Thread Kiran Chandramohan via llvm-branch-commits
@@ -4290,6 +4291,18 @@ class FirConverter : public Fortran::lower::AbstractConverter { assert(blockId == 0 && "invalid blockId"); assert(activeConstructStack.empty() && "invalid construct stack state"); +// Set target_cpu and target_features attributes to be

[llvm-branch-commits] [flang] [Flang][OpenMP] Restructure recursive lowering in `createBodyOfOp` (PR #77761)

2024-01-15 Thread Kiran Chandramohan via llvm-branch-commits
kiranchandramohan wrote: @tblah mentions that this patch fixes the unstructured code issue in worksharing loop with collapse. https://github.com/llvm/llvm-project/pull/77329. https://github.com/llvm/llvm-project/pull/77761 ___ llvm-branch-commits

[llvm-branch-commits] [flang] [Flang][OpenMP] Handle SECTION construct from within SECTIONS (PR #77759)

2024-01-12 Thread Kiran Chandramohan via llvm-branch-commits
kiranchandramohan wrote: > This makes it unnecessary to embed OpenMPSectionConstruct inside of > OpenMPSectionConstruct anymore. What do you mean by this? Is there a typo? Would we be able to remove `OpenMPSectionConstruct` from `struct OpenMPConstruct` after this change?

[llvm-branch-commits] [mlir] 268ff38 - [MLIR][OpenMP] Attribute to include WsLoop upperbound

2021-01-08 Thread Kiran Chandramohan via llvm-branch-commits
Author: Kiran Chandramohan Date: 2021-01-08T14:42:18Z New Revision: 268ff38a716157c362b8d463e2e5655f25972e42 URL: https://github.com/llvm/llvm-project/commit/268ff38a716157c362b8d463e2e5655f25972e42 DIFF: https://github.com/llvm/llvm-project/commit/268ff38a716157c362b8d463e2e5655f25972e42.diff