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

Chris Lattner lattner at cs.uiuc.edu
Sat Apr 9 18:13:31 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.76 -> 1.77
SelectionDAG.cpp updated: 1.67 -> 1.68
---
Log message:

Fix a thinko.  If the operand is promoted, pass the promoted value into
the new zero extend, not the original operand.  This fixes cast bool -> long
on ppc.

Add an unrelated fixme


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

 LegalizeDAG.cpp  |    2 +-
 SelectionDAG.cpp |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.76 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.77
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.76	Fri Apr  8 22:30:19 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Sat Apr  9 20:13:15 2005
@@ -1937,7 +1937,7 @@
 
     // The low part is just a zero extension of the input (which degenerates to
     // a copy).
-    Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, LegalizeOp(Node->getOperand(0)));
+    Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, In);
     
     // The high part is just a zero.
     Hi = DAG.getConstant(0, NVT);


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.67 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.68
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.67	Sat Apr  9 16:43:54 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Sat Apr  9 20:13:15 2005
@@ -767,6 +767,10 @@
       if (N2C->isAllOnesValue())
 	return N1;                // X and -1 -> X
 
+      // FIXME: Should add a corresponding version of this for
+      // ZERO_EXTEND/SIGN_EXTEND by converting them to an ANY_EXTEND node which
+      // we don't have yet.
+
       // and (zero_extend_inreg x:16:32), 1 -> and x, 1
       if (N1.getOpcode() == ISD::ZERO_EXTEND_INREG ||
           N1.getOpcode() == ISD::SIGN_EXTEND_INREG) {






More information about the llvm-commits mailing list