summaryrefslogtreecommitdiff
path: root/mlir/lib
diff options
context:
space:
mode:
authorKiran Chandramohan <kiran.chandramohan@arm.com>2023-03-14 21:51:02 +0000
committerKiran Chandramohan <kiran.chandramohan@arm.com>2023-03-14 21:51:22 +0000
commitc1125ae5b05f5e23c7e61e85afb359e095444d18 (patch)
tree39af1f451de40badce05188a9c96f370e7b01e3e /mlir/lib
parentf51bdae4e3d603de81b7efab82889677dee276fa (diff)
downloadllvm-c1125ae5b05f5e23c7e61e85afb359e095444d18.tar.gz
[MLIR] : Add integer mul in scf to openmp conversion
Add conversion for integer multiplication in scf reductions in the SCF to OpenMP dialect conversion. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D145948
Diffstat (limited to 'mlir/lib')
-rw-r--r--mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
index f843c3d815ab..e91cd0c24171 100644
--- a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
+++ b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
@@ -310,6 +310,10 @@ static omp::ReductionDeclareOp declareReduction(PatternRewriter &builder,
return createDecl(builder, symbolTable, reduce,
builder.getFloatAttr(type, 1.0));
}
+ if (matchSimpleReduction<arith::MulIOp, LLVM::MulOp>(reduction)) {
+ return createDecl(builder, symbolTable, reduce,
+ builder.getIntegerAttr(type, 1));
+ }
// Match select-based min/max reductions.
bool isMin;