diff options
author | Kiran Chandramohan <kiran.chandramohan@arm.com> | 2023-03-14 21:51:02 +0000 |
---|---|---|
committer | Kiran Chandramohan <kiran.chandramohan@arm.com> | 2023-03-14 21:51:22 +0000 |
commit | c1125ae5b05f5e23c7e61e85afb359e095444d18 (patch) | |
tree | 39af1f451de40badce05188a9c96f370e7b01e3e /mlir/lib | |
parent | f51bdae4e3d603de81b7efab82889677dee276fa (diff) | |
download | llvm-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.cpp | 4 |
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; |