diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-06-11 17:25:24 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-06-11 17:25:24 +0000 |
| commit | 2691c59e973e6a15f45a92796943f9b730c4c4a3 (patch) | |
| tree | 7b6632f07a225aebb4f0ad0ce8b7b8bdc3fcb385 /llvm/lib | |
| parent | 5215890caef0ad45340779f1b3abe488f8236d34 (diff) | |
| download | bcm5719-llvm-2691c59e973e6a15f45a92796943f9b730c4c4a3.tar.gz bcm5719-llvm-2691c59e973e6a15f45a92796943f9b730c4c4a3.zip | |
Revert "Fix merges of non-zero vector stores"
This reverts commit r239539.
It was causing SDAG assertions while building freetype.
llvm-svn: 239543
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 4ffb4099e7f..a71c6761c75 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -387,13 +387,6 @@ namespace { unsigned SequenceNum; }; - /// This is a helper function for MergeStoresOfConstantsOrVecElts. Returns a - /// constant build_vector of the stored constant values in Stores. - SDValue getMergedConstantVectorStore(SelectionDAG &DAG, - SDLoc SL, - ArrayRef<MemOpLink> Stores, - EVT Ty) const; - /// This is a helper function for MergeConsecutiveStores. When the source /// elements of the consecutive stores are all constants or all extracted /// vector elements, try to merge them into one larger store. @@ -10583,17 +10576,6 @@ struct BaseIndexOffset { }; } // namespace -SDValue DAGCombiner::getMergedConstantVectorStore(SelectionDAG &DAG, - SDLoc SL, - ArrayRef<MemOpLink> Stores, - EVT Ty) const { - SmallVector<SDValue, 8> BuildVector; - - for (const MemOpLink &Store : Stores) - BuildVector.push_back(cast<StoreSDNode>(Store.MemNode)->getValue()); - return DAG.getNode(ISD::BUILD_VECTOR, SL, Ty, BuildVector); -} - bool DAGCombiner::MergeStoresOfConstantsOrVecElts( SmallVectorImpl<MemOpLink> &StoreNodes, EVT MemVT, unsigned NumElem, bool IsConstantSrc, bool UseVector) { @@ -10624,7 +10606,12 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts( EVT Ty = EVT::getVectorVT(*DAG.getContext(), MemVT, NumElem); assert(TLI.isTypeLegal(Ty) && "Illegal vector store"); if (IsConstantSrc) { - StoredVal = getMergedConstantVectorStore(DAG, DL, StoreNodes, Ty); + // A vector store with a constant source implies that the constant is + // zero; we only handle merging stores of constant zeros because the zero + // can be materialized without a load. + // It may be beneficial to loosen this restriction to allow non-zero + // store merging. + StoredVal = DAG.getConstant(0, DL, Ty); } else { SmallVector<SDValue, 8> Ops; for (unsigned i = 0; i < NumElem ; ++i) { |

