[mlir][NFC] Remove some redundant code.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D123487
This commit is contained in:
jacquesguan 2022-04-11 07:56:46 +00:00
parent 7d6528fc37
commit 920527f4b5
1 changed files with 0 additions and 6 deletions

View File

@ -761,15 +761,10 @@ OpFoldResult MinUIOp::fold(ArrayRef<Attribute> operands) {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
OpFoldResult arith::MulFOp::fold(ArrayRef<Attribute> operands) { OpFoldResult arith::MulFOp::fold(ArrayRef<Attribute> operands) {
APFloat floatValue(0.0f), inverseValue(0.0f);
// mulf(x, 1) -> x // mulf(x, 1) -> x
if (matchPattern(getRhs(), m_OneFloat())) if (matchPattern(getRhs(), m_OneFloat()))
return getLhs(); return getLhs();
// mulf(1, x) -> x
if (matchPattern(getLhs(), m_OneFloat()))
return getRhs();
return constFoldBinaryOp<FloatAttr>( return constFoldBinaryOp<FloatAttr>(
operands, [](const APFloat &a, const APFloat &b) { return a * b; }); operands, [](const APFloat &a, const APFloat &b) { return a * b; });
} }
@ -779,7 +774,6 @@ OpFoldResult arith::MulFOp::fold(ArrayRef<Attribute> operands) {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
OpFoldResult arith::DivFOp::fold(ArrayRef<Attribute> operands) { OpFoldResult arith::DivFOp::fold(ArrayRef<Attribute> operands) {
APFloat floatValue(0.0f), inverseValue(0.0f);
// divf(x, 1) -> x // divf(x, 1) -> x
if (matchPattern(getRhs(), m_OneFloat())) if (matchPattern(getRhs(), m_OneFloat()))
return getLhs(); return getLhs();