[PATCH] [mips] Refactor and simplify MipsSEDAGToDAGISel::selectIntAddrLSL2MM(). NFC.

Vasileios Kalintiris Vasileios.Kalintiris at imgtec.com
Fri Feb 13 09:56:08 PST 2015


Hi dsanders,

http://reviews.llvm.org/D7618

Files:
  lib/Target/Mips/MipsSEISelDAGToDAG.cpp

Index: lib/Target/Mips/MipsSEISelDAGToDAG.cpp
===================================================================
--- lib/Target/Mips/MipsSEISelDAGToDAG.cpp
+++ lib/Target/Mips/MipsSEISelDAGToDAG.cpp
@@ -410,18 +410,15 @@
 bool MipsSEDAGToDAGISel::selectIntAddrLSL2MM(SDValue Addr, SDValue &Base,
                                              SDValue &Offset) const {
   if (selectAddrFrameIndexOffset(Addr, Base, Offset, 7)) {
-    if (dyn_cast<FrameIndexSDNode>(Base))
+    if (isa<FrameIndexSDNode>(Base))
       return false;
-    else {
-      ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Offset);
-      if (CN) {
-        unsigned CnstOff = CN->getZExtValue();
-        if (CnstOff == (CnstOff & 0x3c))
-          return true;
-      }
 
-      return false;
+    if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Offset)) {
+      unsigned CnstOff = CN->getZExtValue();
+      return (CnstOff == (CnstOff & 0x3c));
     }
+
+    return false;
   }
 
   // For all other cases where "lw" would be selected, don't select "lw16"

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7618.19905.patch
Type: text/x-patch
Size: 1035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150213/e2c01507/attachment.bin>


More information about the llvm-commits mailing list