[Mlir-commits] [mlir] 920527f - [mlir][NFC] Remove some redundant code.

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Apr 11 19:10:25 PDT 2022


Author: jacquesguan
Date: 2022-04-12T02:10:04Z
New Revision: 920527f4b51b3e2787a97ef3232ebcb4e466316e

URL: https://github.com/llvm/llvm-project/commit/920527f4b51b3e2787a97ef3232ebcb4e466316e
DIFF: https://github.com/llvm/llvm-project/commit/920527f4b51b3e2787a97ef3232ebcb4e466316e.diff

LOG: [mlir][NFC] Remove some redundant code.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D123487

Added: 
    

Modified: 
    mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
index d38f4f1c9994e..edfdda82d9552 100644
--- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
+++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
@@ -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();


        


More information about the Mlir-commits mailing list