summaryrefslogtreecommitdiff
path: root/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp')
-rw-r--r--mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
index e472af257776..a9e7759aa75e 100644
--- a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
+++ b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
@@ -71,8 +71,9 @@ template <
static bool
matchSelectReduction(Block &block, ArrayRef<Predicate> lessThanPredicates,
ArrayRef<Predicate> greaterThanPredicates, bool &isMin) {
- static_assert(llvm::is_one_of<SelectOpTy, SelectOp, LLVM::SelectOp>::value,
- "only std and llvm select ops are supported");
+ static_assert(
+ llvm::is_one_of<SelectOpTy, arith::SelectOp, LLVM::SelectOp>::value,
+ "only arithmetic and llvm select ops are supported");
// Expect exactly three operations in the block.
if (block.empty() || llvm::hasSingleElement(block) ||
@@ -290,7 +291,7 @@ static omp::ReductionDeclareOp declareReduction(PatternRewriter &builder,
// Match select-based min/max reductions.
bool isMin;
- if (matchSelectReduction<arith::CmpFOp, SelectOp>(
+ if (matchSelectReduction<arith::CmpFOp, arith::SelectOp>(
reduction, {arith::CmpFPredicate::OLT, arith::CmpFPredicate::OLE},
{arith::CmpFPredicate::OGT, arith::CmpFPredicate::OGE}, isMin) ||
matchSelectReduction<LLVM::FCmpOp, LLVM::SelectOp>(
@@ -299,7 +300,7 @@ static omp::ReductionDeclareOp declareReduction(PatternRewriter &builder,
return createDecl(builder, symbolTable, reduce,
minMaxValueForFloat(type, !isMin));
}
- if (matchSelectReduction<arith::CmpIOp, SelectOp>(
+ if (matchSelectReduction<arith::CmpIOp, arith::SelectOp>(
reduction, {arith::CmpIPredicate::slt, arith::CmpIPredicate::sle},
{arith::CmpIPredicate::sgt, arith::CmpIPredicate::sge}, isMin) ||
matchSelectReduction<LLVM::ICmpOp, LLVM::SelectOp>(
@@ -311,7 +312,7 @@ static omp::ReductionDeclareOp declareReduction(PatternRewriter &builder,
isMin ? LLVM::AtomicBinOp::min : LLVM::AtomicBinOp::max,
decl, reduce);
}
- if (matchSelectReduction<arith::CmpIOp, SelectOp>(
+ if (matchSelectReduction<arith::CmpIOp, arith::SelectOp>(
reduction, {arith::CmpIPredicate::ult, arith::CmpIPredicate::ule},
{arith::CmpIPredicate::ugt, arith::CmpIPredicate::uge}, isMin) ||
matchSelectReduction<LLVM::ICmpOp, LLVM::SelectOp>(