[VectorLegalizer] Remove broken code in ExpandStore.

The code that is supposed to "Round odd types to the next pow of two" seems
broken and as well completely unused (untested). It also seems that
ExpandStore really shouldn't ever change the memory VT, which this in fact
does.

As a first step in fixing the broken handling of vector stores (of irregular
types, e.g. an i1 vector), this code is removed. For discussion, see
https://bugs.llvm.org/show_bug.cgi?id=35520.

Review: Eli Friedman
llvm-svn: 322275
This commit is contained in:
Jonas Paulsson 2018-01-11 13:03:21 +00:00
parent 5a65e67d5d
commit 9b395a12ed
1 changed files with 0 additions and 28 deletions

View File

@ -663,34 +663,6 @@ SDValue VectorLegalizer::ExpandLoad(SDValue Op) {
SDValue VectorLegalizer::ExpandStore(SDValue Op) {
StoreSDNode *ST = cast<StoreSDNode>(Op.getNode());
EVT StVT = ST->getMemoryVT();
EVT MemSclVT = StVT.getScalarType();
unsigned ScalarSize = MemSclVT.getSizeInBits();
// Round odd types to the next pow of two.
if (!isPowerOf2_32(ScalarSize)) {
// FIXME: This is completely broken and inconsistent with ExpandLoad
// handling.
// For sub-byte element sizes, this ends up with 0 stride between elements,
// so the same element just gets re-written to the same location. There seem
// to be tests explicitly testing for this broken behavior though. tests
// for this broken behavior.
LLVMContext &Ctx = *DAG.getContext();
EVT NewMemVT
= EVT::getVectorVT(Ctx,
MemSclVT.getIntegerVT(Ctx, NextPowerOf2(ScalarSize)),
StVT.getVectorNumElements());
SDValue NewVectorStore = DAG.getTruncStore(
ST->getChain(), SDLoc(Op), ST->getValue(), ST->getBasePtr(),
ST->getPointerInfo(), NewMemVT, ST->getAlignment(),
ST->getMemOperand()->getFlags(), ST->getAAInfo());
ST = cast<StoreSDNode>(NewVectorStore.getNode());
}
SDValue TF = TLI.scalarizeVectorStore(ST, DAG);
AddLegalizedOperand(Op, TF);
return TF;