diff options
| author | River Riddle <riddleriver@gmail.com> | 2022-01-31 12:44:35 -0800 |
|---|---|---|
| committer | River Riddle <riddleriver@gmail.com> | 2022-02-02 14:45:12 -0800 |
| commit | dec8af701ff25ea967d47d196e5247306754f8e8 (patch) | |
| tree | bc97be48cda161784ef3a44819a6d93781b6da18 /mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp | |
| parent | 6a8ba3186ed561bd5ac6aa31ba483d81223bf198 (diff) | |
[mlir] Move SelectOp from Standard to Arithmetic
This is part of splitting up the standard dialect. See https://llvm.discourse.group/t/standard-dialect-the-final-chapter/ for discussion.
Differential Revision: https://reviews.llvm.org/D118648
Diffstat (limited to 'mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp')
| -rw-r--r-- | mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp | 11 |
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>( |
