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

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 22 21:29:16 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.332 -> 1.333
---
Log message:

simplify some code


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

 LegalizeDAG.cpp |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.332 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.333
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.332	Wed Mar 22 14:09:34 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Wed Mar 22 23:29:04 2006
@@ -3435,14 +3435,11 @@
     // word offset constant for Hi/Lo address computation
     SDOperand WordOff = DAG.getConstant(sizeof(int), TLI.getPointerTy());
     // set up Hi and Lo (into buffer) address based on endian
-    SDOperand Hi, Lo;
-    if (TLI.isLittleEndian()) {
-      Hi = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot, WordOff);
-      Lo = StackSlot;
-    } else {
-      Hi = StackSlot;
-      Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot, WordOff);
-    }
+    SDOperand Hi = StackSlot;
+    SDOperand Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot,WordOff);
+    if (TLI.isLittleEndian())
+      std::swap(Hi, Lo);
+    
     // if signed map to unsigned space
     SDOperand Op0Mapped;
     if (isSigned) {






More information about the llvm-commits mailing list