[llvm] r299022 - [DAGCombiner] Remove else after return. NFCI.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 12:39:46 PDT 2017


Author: davide
Date: Wed Mar 29 14:39:46 2017
New Revision: 299022

URL: http://llvm.org/viewvc/llvm-project?rev=299022&view=rev
Log:
[DAGCombiner] Remove else after return. NFCI.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=299022&r1=299021&r2=299022&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Mar 29 14:39:46 2017
@@ -4665,10 +4665,9 @@ const Optional<ByteProvider> calculateBy
 
     if (LHS->isConstantZero())
       return RHS;
-    else if (RHS->isConstantZero())
+    if (RHS->isConstantZero())
       return LHS;
-    else
-      return None;
+    return None;
   }
   case ISD::SHL: {
     auto ShiftOp = dyn_cast<ConstantSDNode>(Op->getOperand(1));
@@ -4698,8 +4697,7 @@ const Optional<ByteProvider> calculateBy
       return Op.getOpcode() == ISD::ZERO_EXTEND
                  ? Optional<ByteProvider>(ByteProvider::getConstantZero())
                  : None;
-    else
-      return calculateByteProvider(NarrowOp, Index, Depth + 1);
+    return calculateByteProvider(NarrowOp, Index, Depth + 1);
   }
   case ISD::BSWAP:
     return calculateByteProvider(Op->getOperand(0), ByteWidth - Index - 1,
@@ -4718,8 +4716,7 @@ const Optional<ByteProvider> calculateBy
       return L->getExtensionType() == ISD::ZEXTLOAD
                  ? Optional<ByteProvider>(ByteProvider::getConstantZero())
                  : None;
-    else
-      return ByteProvider::getMemory(L, Index);
+    return ByteProvider::getMemory(L, Index);
   }
   }
 




More information about the llvm-commits mailing list