diff options
author | Chris Lattner <sabre@nondot.org> | 2011-04-09 02:32:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-04-09 02:32:02 +0000 |
commit | 41c80e89f38605baa06365d87f6fe6742ae2dec4 (patch) | |
tree | 1ea54c8281ea25746c5369eb48bdb47bb1edd416 /llvm/lib/CodeGen | |
parent | 1c42a4d159ea95b89a60c4a04a1b5b1bde2e9ea7 (diff) | |
download | bcm5719-llvm-41c80e89f38605baa06365d87f6fe6742ae2dec4.tar.gz bcm5719-llvm-41c80e89f38605baa06365d87f6fe6742ae2dec4.zip |
have dag combine zap "store undef", which can be formed during call lowering
with undef arguments.
llvm-svn: 129185
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index a9afec8b216..6ad85fa130a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -6264,6 +6264,10 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { Ptr, ST->getPointerInfo(), ST->isVolatile(), ST->isNonTemporal(), OrigAlign); } + + // Turn 'store undef, Ptr' -> nothing. + if (Value.getOpcode() == ISD::UNDEF && ST->isUnindexed()) + return Chain; // Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr' if (ConstantFPSDNode *CFP = dyn_cast<ConstantFPSDNode>(Value)) { @@ -6298,8 +6302,10 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { return DAG.getStore(Chain, N->getDebugLoc(), Tmp, Ptr, ST->getPointerInfo(), ST->isVolatile(), ST->isNonTemporal(), ST->getAlignment()); - } else if (!ST->isVolatile() && - TLI.isOperationLegalOrCustom(ISD::STORE, MVT::i32)) { + } + + if (!ST->isVolatile() && + TLI.isOperationLegalOrCustom(ISD::STORE, MVT::i32)) { // Many FP stores are not made apparent until after legalize, e.g. for // argument passing. Since this is so common, custom legalize the // 64-bit integer store into two 32-bit stores. |