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

Chris Lattner lattner at cs.uiuc.edu
Tue Apr 4 10:39:30 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.143 -> 1.144
---
Log message:

Do not create ZEXTLOAD's unless we are before legalize or the operation is
legal.


---
Diffs of the changes:  (+2 -1)

 DAGCombiner.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.143 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.144
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.143	Mon Apr  3 12:29:28 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Tue Apr  4 12:39:18 2006
@@ -1193,7 +1193,8 @@
     
     LoadedVT = N0.getOpcode() == ISD::LOAD ? VT :
                            cast<VTSDNode>(N0.getOperand(3))->getVT();
-    if (EVT != MVT::Other && LoadedVT > EVT) {
+    if (EVT != MVT::Other && LoadedVT > EVT &&
+        (!AfterLegalize || TLI.isOperationLegal(ISD::ZEXTLOAD, EVT))) {
       MVT::ValueType PtrType = N0.getOperand(1).getValueType();
       // For big endian targets, we need to add an offset to the pointer to load
       // the correct bytes.  For little endian systems, we merely need to read






More information about the llvm-commits mailing list