[mlir][LLVM] Fix incorrect verification of atomicrmw f{min,max}imumnum (#190474)
Fix llvm.atomicrmw fminimumnum and fmaximumnum to correctly take the float operation verification path.
This commit is contained in:
parent
ff4c6fe24e
commit
420111e9e4
@ -3663,7 +3663,9 @@ LogicalResult AtomicRMWOp::verify() {
|
||||
if (getBinOp() == AtomicBinOp::fadd || getBinOp() == AtomicBinOp::fsub ||
|
||||
getBinOp() == AtomicBinOp::fmin || getBinOp() == AtomicBinOp::fmax ||
|
||||
getBinOp() == AtomicBinOp::fminimum ||
|
||||
getBinOp() == AtomicBinOp::fmaximum) {
|
||||
getBinOp() == AtomicBinOp::fmaximum ||
|
||||
getBinOp() == AtomicBinOp::fminimumnum ||
|
||||
getBinOp() == AtomicBinOp::fmaximumnum) {
|
||||
if (isCompatibleVectorType(valType)) {
|
||||
if (isScalableVectorType(valType))
|
||||
return emitOpError("expected LLVM IR fixed vector type");
|
||||
|
||||
@ -547,6 +547,8 @@ func.func @atomicrmw(%ptr : !llvm.ptr, %f32 : f32, %f16_vec : vector<2xf16>) {
|
||||
%1 = llvm.atomicrmw volatile fsub %ptr, %f32 syncscope("singlethread") monotonic {alignment = 16 : i64} : !llvm.ptr, f32
|
||||
// CHECK: llvm.atomicrmw fmin %{{.*}}, %{{.*}} monotonic : !llvm.ptr, vector<2xf16>
|
||||
%2 = llvm.atomicrmw fmin %ptr, %f16_vec monotonic : !llvm.ptr, vector<2xf16>
|
||||
// CHECK: llvm.atomicrmw fminimumnum %{{.*}}, %{{.*}} monotonic : !llvm.ptr, f32
|
||||
%3 = llvm.atomicrmw fminimumnum %ptr, %f32 monotonic : !llvm.ptr, f32
|
||||
llvm.return
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user