From dec8af701ff25ea967d47d196e5247306754f8e8 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Mon, 31 Jan 2022 12:44:35 -0800 Subject: [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 --- mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp') 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 lessThanPredicates, ArrayRef greaterThanPredicates, bool &isMin) { - static_assert(llvm::is_one_of::value, - "only std and llvm select ops are supported"); + static_assert( + llvm::is_one_of::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( + if (matchSelectReduction( reduction, {arith::CmpFPredicate::OLT, arith::CmpFPredicate::OLE}, {arith::CmpFPredicate::OGT, arith::CmpFPredicate::OGE}, isMin) || matchSelectReduction( @@ -299,7 +300,7 @@ static omp::ReductionDeclareOp declareReduction(PatternRewriter &builder, return createDecl(builder, symbolTable, reduce, minMaxValueForFloat(type, !isMin)); } - if (matchSelectReduction( + if (matchSelectReduction( reduction, {arith::CmpIPredicate::slt, arith::CmpIPredicate::sle}, {arith::CmpIPredicate::sgt, arith::CmpIPredicate::sge}, isMin) || matchSelectReduction( @@ -311,7 +312,7 @@ static omp::ReductionDeclareOp declareReduction(PatternRewriter &builder, isMin ? LLVM::AtomicBinOp::min : LLVM::AtomicBinOp::max, decl, reduce); } - if (matchSelectReduction( + if (matchSelectReduction( reduction, {arith::CmpIPredicate::ult, arith::CmpIPredicate::ule}, {arith::CmpIPredicate::ugt, arith::CmpIPredicate::uge}, isMin) || matchSelectReduction( -- cgit v1.2.3