Skip to content

Commit

Permalink
[mlir][MemRefToLLVM] Add fmin, fmax to AtomicRMW lowering
Browse files Browse the repository at this point in the history
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
  • Loading branch information
krzysz00 committed Aug 21, 2023
1 parent c0c8366 commit 7db1853
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7db1853

Please sign in to comment.