[Mlir-commits] [mlir] 7db1853 - [mlir][MemRefToLLVM] Add fmin, fmax to AtomicRMW lowering

Krzysztof Drewniak llvmlistbot at llvm.org
Mon Aug 21 14:20:57 PDT 2023


Author: Krzysztof Drewniak
Date: 2023-08-21T21:20:52Z
New Revision: 7db18533b99df72f1236047ef1b4d4e8a4575c63

URL: https://github.com/llvm/llvm-project/commit/7db18533b99df72f1236047ef1b4d4e8a4575c63
DIFF: https://github.com/llvm/llvm-project/commit/7db18533b99df72f1236047ef1b4d4e8a4575c63.diff

LOG: [mlir][MemRefToLLVM] Add fmin, fmax to AtomicRMW lowering

Add cases to the memref.atomicrmw lowering for floating-point min and
max, since LLVM supports these.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D158283

Added: 
    

Modified: 
    mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp b/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
index 8843ab78eed782..9bd0797a5ccb79 100644
--- a/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
+++ b/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
@@ -1753,10 +1753,14 @@ matchSimpleAtomicOp(memref::AtomicRMWOp atomicOp) {
     return LLVM::AtomicBinOp::add;
   case arith::AtomicRMWKind::assign:
     return LLVM::AtomicBinOp::xchg;
+  case arith::AtomicRMWKind::maxf:
+    return LLVM::AtomicBinOp::fmax;
   case arith::AtomicRMWKind::maxs:
     return LLVM::AtomicBinOp::max;
   case arith::AtomicRMWKind::maxu:
     return LLVM::AtomicBinOp::umax;
+  case arith::AtomicRMWKind::minf:
+    return LLVM::AtomicBinOp::fmin;
   case arith::AtomicRMWKind::mins:
     return LLVM::AtomicBinOp::min;
   case arith::AtomicRMWKind::minu:


        


More information about the Mlir-commits mailing list