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

Chris Lattner lattner at cs.uiuc.edu
Thu Dec 22 21:48:19 PST 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

DAGCombiner.cpp updated: 1.73 -> 1.74
---
Log message:

Simplify store(bitconv(x)) to store(x).  This allows us to compile this:

void bar(double Y, double *X) {
  *X = Y;
}

to this:

bar:
        save -96, %o6, %o6
        st %i1, [%i2+4]
        st %i0, [%i2]
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

bar:
        save -104, %o6, %o6
        st %i1, [%i6+-4]
        st %i0, [%i6+-8]
        ldd [%i6+-8], %f0
        std  %f0, [%i2]
        restore %g0, %g0, %g0
        retl
        nop

on sparcv8.



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

 DAGCombiner.cpp |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.73 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.74
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.73	Thu Dec 22 23:44:41 2005
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp	Thu Dec 22 23:48:07 2005
@@ -2081,6 +2081,11 @@
     return SDOperand(N, 0);
   }
   
+  // If this is a store of a bit convert, store the input value.
+  if (Value.getOpcode() == ISD::BIT_CONVERT)
+    return DAG.getNode(ISD::STORE, MVT::Other, Chain, Value.getOperand(0),
+                       Ptr, SrcValue);
+  
   return SDOperand();
 }
 






More information about the llvm-commits mailing list