diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-23 05:48:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-23 05:48:07 +0000 |
commit | c33baaafb6fb59eb4077f7b2cadff6cf743ce605 (patch) | |
tree | ae388850d9de874155e1d3c228bca1417187d774 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 5710410deaceab136878e73dc48b6d468cff9701 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f08fd10413..52e8391f37 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(); } |