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
llvmbot wrote:
@llvm/pr-subscribers-flang-fir-hlfir
Author: Tom Eccles (tblah)
Changes
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 suppo
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
@@ -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
@@ -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
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
@@ -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,
+
@@ -465,8 +642,8 @@ void ReductionProcessor::addReductionDecl(
if (auto declOp = symVal.getDefiningOp())
symVal = declOp.getBase();
auto redType = symVal.getType().cast();
-assert(redType.getEleTy().isIntOrIndexOrFloat() &&
-
@@ -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
tblah
@@ -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
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
@@ -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
@@ -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/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
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
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
@@ -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
24 matches
Mail list logo