From 0637d38ec2b79712468c535730be8a055fcc2357 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 23 Dec 2005 05:48:07 +0000 Subject: [PATCH] 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. llvm-svn: 24983 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f08fd10413c..52e8391f372 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2081,6 +2081,11 @@ SDOperand DAGCombiner::visitSTORE(SDNode *N) { 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(); }