[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Apr 9 21:33:24 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.69 -> 1.70
---
Log message:

Fold zext_inreg(zextload), likewise for sext's


---
Diffs of the changes:  (+6 -0)

 SelectionDAG.cpp |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.69 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.70
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.69	Sat Apr  9 23:04:49 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Sat Apr  9 23:33:08 2005
@@ -1101,6 +1101,12 @@
         return N1;
     }
 
+    // If we are (zero|sign) extending a [zs]extload, return just the load.
+    if ((N1.getOpcode() == ISD::ZEXTLOAD && Opcode == ISD::ZERO_EXTEND_INREG) ||
+        (N1.getOpcode() == ISD::SEXTLOAD && Opcode == ISD::SIGN_EXTEND_INREG))
+      if (cast<MVTSDNode>(N1)->getExtraValueType() <= EVT)
+        return N1;
+
     // If we are extending the result of a setcc, and we already know the
     // contents of the top bits, eliminate the extension.
     if (N1.getOpcode() == ISD::SETCC)






More information about the llvm-commits mailing list