diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-03-30 21:15:18 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-03-30 21:15:18 +0000 |
commit | 46ba31650e9eb5f95990adc240c7d1e925c57381 (patch) | |
tree | fa57e5c899d2372ae9440d7feace8467347ef3ae /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | a4b1b6ea05645c8baacd5770540cf8c57549632b (diff) | |
download | bcm5719-llvm-46ba31650e9eb5f95990adc240c7d1e925c57381.tar.gz bcm5719-llvm-46ba31650e9eb5f95990adc240c7d1e925c57381.zip |
LegalizeDAG: Don't replace vector store with integer if not legal
For the same reason as the corresponding load change.
Note that ExpandStore is completely broken for non-byte sized element
vector stores, but preserve the current broken behavior which has tests
for it. The behavior should be the same, but now introduces a new typed
store that is incorrectly split later rather than doing it directly.
llvm-svn: 264928
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index d9f75ad0b5c..9129e715a63 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -327,6 +327,12 @@ static void ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG, ST->getMemoryVT().isVector()) { EVT intVT = EVT::getIntegerVT(*DAG.getContext(), VT.getSizeInBits()); if (TLI.isTypeLegal(intVT)) { + if (!TLI.isOperationLegalOrCustom(ISD::STORE, intVT)) { + // Scalarize the store and let the individual components be handled. + SDValue Result = TLI.scalarizeVectorStore(ST, DAG); + DAGLegalize->ReplaceNode(SDValue(ST, 0), Result); + return; + } // Expand to a bitconvert of the value to the integer type of the // same size, then a (misaligned) int store. // FIXME: Does not handle truncating floating point stores! |