Skip to content

Commit 18e9504

Browse files
author
Xiang Li
committed
Remove ninf which is not needed.
1 parent bdb0f61 commit 18e9504

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

mlir/lib/Dialect/Arith/IR/ArithOps.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,10 +1282,8 @@ OpFoldResult arith::MulFOp::fold(FoldAdaptor adaptor) {
12821282
if (matchPattern(adaptor.getRhs(), m_OneFloat()))
12831283
return getLhs();
12841284

1285-
arith::FastMathFlags fmf = getFastmath();
1286-
if (arith::bitEnumContainsAll(fmf, arith::FastMathFlags::nnan |
1287-
arith::FastMathFlags::ninf |
1288-
arith::FastMathFlags::nsz)) {
1285+
if (arith::bitEnumContainsAll(getFastmath(), arith::FastMathFlags::nnan |
1286+
arith::FastMathFlags::nsz)) {
12891287
// mulf(x, 0) -> 0
12901288
if (matchPattern(adaptor.getRhs(), m_AnyZeroFloat()))
12911289
return getRhs();

mlir/test/Dialect/Arith/canonicalize.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,7 @@ func.func @test_mulf2(%arg0 : f32) -> f32 {
22212221
// CHECK-NEXT: %[[C0:.+]] = arith.constant 0.000000e+00 : f32
22222222
// CHECK-NEXT: return %[[C0]]
22232223
%c0 = arith.constant 0.0 : f32
2224-
%0 = arith.mulf %c0, %arg0 fastmath<nnan,ninf,nsz> : f32
2224+
%0 = arith.mulf %c0, %arg0 fastmath<nnan,nsz> : f32
22252225
return %0 : f32
22262226
}
22272227

0 commit comments

Comments
 (0)