https://github.com/kiranchandramohan approved this pull request.
LG.
Declarative directives have to be propagated to module files but for the
purpose of generating TODOs, this is not required.
https://github.com/llvm/llvm-project/pull/123397
___
llvm
https://github.com/kiranchandramohan approved this pull request.
LG.
The specification part has to be emitted in module files. But this is not
necessary for producing the TODOs.
https://github.com/llvm/llvm-project/pull/123397
___
llvm-branch-commits
Author: Kiran Chandramohan
Date: 2025-01-20T16:23:54Z
New Revision: ea3aa97c17ce30df40f8fc8c2ebb89332c83c5b8
URL:
https://github.com/llvm/llvm-project/commit/ea3aa97c17ce30df40f8fc8c2ebb89332c83c5b8
DIFF:
https://github.com/llvm/llvm-project/commit/ea3aa97c17ce30df40f8fc8c2ebb89332c83c5b8.diff
https://github.com/kiranchandramohan approved this pull request.
LG.
https://github.com/llvm/llvm-project/pull/121817
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-co
@@ -265,6 +265,7 @@ def OMPC_Map : Clause<"map"> {
let flangClass = "OmpMapClause";
}
def OMPC_Match : Clause<"match"> {
+ let flangClass = "OmpMatchClause";
kiranchandramohan wrote:
Is there a test for Match?
https://github.com/llvm/llvm-project/pull/1218
https://github.com/kiranchandramohan commented:
Minor comments.
https://github.com/llvm/llvm-project/pull/121817
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -214,6 +214,11 @@ class AssociatedLoopChecker {
};
bool OmpStructureChecker::CheckAllowedClause(llvmOmpClause clause) {
+ // Do not do clause checks while processing METADIRECTIVE.
kiranchandramohan wrote:
Could you add the reason also?
https://github.co
@@ -845,7 +851,8 @@ def OMP_Metadirective : Directive<"metadirective"> {
VersionedClause,
];
let allowedOnceClauses = [
-VersionedClause,
+VersionedClause,
+VersionedClause,
kiranchandramohan wrote:
Is this tested in Flang?
https://github.
https://github.com/kiranchandramohan edited
https://github.com/llvm/llvm-project/pull/121817
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1000,6 +1000,7 @@ def MapInfoOp : OpenMP_Op<"map.info",
[AttrSizedOperandSegments]> {
OptionalAttr:$members_index,
Variadic:$bounds, /* rank-0 to
rank-{n-1} */
OptionalAttr:$map_type,
+
@@ -1000,6 +1000,7 @@ def MapInfoOp : OpenMP_Op<"map.info",
[AttrSizedOperandSegments]> {
OptionalAttr:$members_index,
Variadic:$bounds, /* rank-0 to
rank-{n-1} */
OptionalAttr:$map_type,
+
https://github.com/kiranchandramohan approved this pull request.
LGTM.
https://github.com/llvm/llvm-project/pull/121815
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list);
#define MODIFIERS() std::optional>
+inline namespace traits {
+// trait-property-name ->
+//identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTra
https://github.com/kiranchandramohan commented:
Nice work.
A few minor comments.
https://github.com/llvm/llvm-project/pull/121815
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/l
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list);
#define MODIFIERS() std::optional>
+inline namespace traits {
+// trait-property-name ->
+//identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTra
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list);
#define MODIFIERS() std::optional>
+inline namespace traits {
+// trait-property-name ->
+//identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTra
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list);
#define MODIFIERS() std::optional>
+inline namespace traits {
+// trait-property-name ->
+//identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTra
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list);
#define MODIFIERS() std::optional>
+inline namespace traits {
+// trait-property-name ->
+//identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTra
@@ -3474,6 +3477,138 @@ WRAPPER_CLASS(OmpObjectList, std::list);
#define MODIFIERS() std::optional>
+inline namespace traits {
+// trait-property-name ->
+//identifier | string-literal
+struct OmpTraitPropertyName {
+ CharBlock source;
+ WRAPPER_CLASS_BOILERPLATE(OmpTra
https://github.com/kiranchandramohan edited
https://github.com/llvm/llvm-project/pull/121815
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -153,6 +153,81 @@ static TypeDeclarationStmt
makeIterSpecDecl(std::list &&names) {
makeEntityList(std::move(names)));
}
+// --- Parsers for context traits -
+
+TYPE_PARSER(sourced(construct( //
+(space >> charLiteralConstantWit
@@ -3453,6 +3453,17 @@ WRAPPER_CLASS(PauseStmt, std::optional);
// --- Common definitions
+struct OmpClause;
+struct OmpClauseList;
+
+struct OmpDirectiveSpecification {
+ TUPLE_CLASS_BOILERPLATE(OmpDirectiveSpecification);
+ std::tuple>>
+ t;
+ CharBlock source;
+};
kiranchandramohan wrote:
> @kiranchandramohan I discussed the current approach with @skatrak today. When
> trying to implement the mapper lowering for the map clause, it became
> apparent that we need to add the `declMapperOp` name to the `SymbolTable`. As
> such, we would also need to hoist t
@@ -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
https://github.com/kiranchandramohan approved this pull request.
LG.
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-co
@@ -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
@@ -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
@@ -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
@@ -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
https://github.com/kiranchandramohan approved this pull request.
LG. Thanks.
https://github.com/llvm/llvm-project/pull/117231
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-b
https://github.com/kiranchandramohan approved this pull request.
LG.
https://github.com/llvm/llvm-project/pull/113622
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-co
https://github.com/kiranchandramohan edited
https://github.com/llvm/llvm-project/pull/113622
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -3307,6 +3307,15 @@ void OmpStructureChecker::Enter(const
parser::OmpClause::Depend &x) {
}
}
}
+if (std::get>(inOut->t)) {
+ unsigned version{context_.langOptions().OpenMPVersion};
+ unsigned allowedInVersion = 50;
kiranchan
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
https://lists.llvm.org/cgi-bin/mailman/
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com
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
https://li
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com
@@ -2012,34 +2012,87 @@ void OmpAttributeVisitor::Post(const parser::Name
&name) {
}
}
}
-std::vector defaultDSASymbols;
+
+// Implicitly determined DSAs
+// OMP 5.2 5.1.1 - Variables Referenced in a Construct
+Symbol *lastDeclSymbol = nullptr
@@ -2012,34 +2012,87 @@ void OmpAttributeVisitor::Post(const parser::Name
&name) {
}
}
}
-std::vector defaultDSASymbols;
+
+// Implicitly determined DSAs
+// OMP 5.2 5.1.1 - Variables Referenced in a Construct
+Symbol *lastDeclSymbol = nullptr
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm
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
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm
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 fo
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
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 ma
@@ -1108,6 +1108,35 @@ hlfir::createTempFromMold(mlir::Location loc,
fir::FirOpBuilder &builder,
return {hlfir::Entity{declareOp.getBase()}, isHeapAlloc};
}
+hlfir::Entity hlfir::createStackTempFromMold(mlir::Location loc,
kiranchandramohan wrote:
@ergawy
@@ -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,
+
@@ -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
@@ -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
kiran
@@ -465,8 +642,8 @@ void ReductionProcessor::addReductionDecl(
if (auto declOp = symVal.getDefiningOp())
symVal = declOp.getBase();
auto redType = symVal.getType().cast();
-assert(redType.getEleTy().isIntOrIndexOrFloat() &&
-
@@ -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
@@ -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,
+
@@ -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
kiran
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
https://lists.llvm.org/cgi-bin/mailman/listinf
@@ -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,
+
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
@@ -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 :
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/
@@ -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 :
@@ -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 :
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
@@ -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 necess
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
https://lists.llvm.org/cgi-bin/mai
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
https://lists.llvm.org/cgi-bin/mailman/listi
@@ -410,8 +410,15 @@ class FIROpConversion : public
mlir::ConvertOpToLLVMPattern {
mlir::ConversionPatternRewriter &rewriter) const {
auto thisPt = rewriter.saveInsertionPoint();
mlir::Operation *parentOp = rewriter.getInsertionBlock()->getParentOp();
-mlir::
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
https://lists.
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com
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
https://
@@ -135,138 +133,135 @@ void DataSharingProcessor::insertBarrier() {
void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) {
bool cmpCreated = false;
mlir::OpBuilder::InsertPoint localInsPt = firOpBuilder.saveInsertionPoint();
- for (const Fortran::parse
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/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
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
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-co
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
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@lists.ll
@@ -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 passe
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
@@ -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 passe
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 mail
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?
https://github.com/ll
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
81 matches
Mail list logo