forked from OSchip/llvm-project
[mlir][NFC] Remove some redundant code.
Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D123487
This commit is contained in:
parent
7d6528fc37
commit
920527f4b5
|
@ -761,15 +761,10 @@ OpFoldResult MinUIOp::fold(ArrayRef<Attribute> operands) {
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
OpFoldResult arith::MulFOp::fold(ArrayRef<Attribute> operands) {
|
||||
APFloat floatValue(0.0f), inverseValue(0.0f);
|
||||
// mulf(x, 1) -> x
|
||||
if (matchPattern(getRhs(), m_OneFloat()))
|
||||
return getLhs();
|
||||
|
||||
// mulf(1, x) -> x
|
||||
if (matchPattern(getLhs(), m_OneFloat()))
|
||||
return getRhs();
|
||||
|
||||
return constFoldBinaryOp<FloatAttr>(
|
||||
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) {
|
||||
APFloat floatValue(0.0f), inverseValue(0.0f);
|
||||
// divf(x, 1) -> x
|
||||
if (matchPattern(getRhs(), m_OneFloat()))
|
||||
return getLhs();
|
||||
|
|
Loading…
Reference in New Issue