diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-12-02 17:14:09 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-12-02 17:14:09 +0000 |
commit | 1157e1410c833b5a167807370a68c073961c6f5c (patch) | |
tree | c68f531893198f2477bbb53f2ff5d9b759a4ce38 /llvm/lib/CodeGen/SelectionDAG | |
parent | 65e7c6626a85280aa75127e5b65070ae19f75f46 (diff) | |
download | bcm5719-llvm-1157e1410c833b5a167807370a68c073961c6f5c.tar.gz bcm5719-llvm-1157e1410c833b5a167807370a68c073961c6f5c.zip |
Allow merging multiple store sequences on the same chain.
llvm-svn: 169111
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5659069178b..438e23da34b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -8157,8 +8157,21 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { // Only perform this optimization before the types are legal, because we // don't want to perform this optimization on every DAGCombine invocation. - if (!LegalTypes && MergeConsecutiveStores(ST)) - return SDValue(N, 0); + if (!LegalTypes) { + bool EverChanged = false; + + do { + // There can be multiple store sequences on the same chain. + // Keep trying to merge store sequences until we are unable to do so + // or until we merge the last store on the chain. + bool Changed = MergeConsecutiveStores(ST); + EverChanged |= Changed; + if (!Changed) break; + } while (ST->getOpcode() != ISD::DELETED_NODE); + + if (EverChanged) + return SDValue(N, 0); + } return ReduceLoadOpStoreWidth(N); } |