diff options
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/AsmPrinter/WinException.cpp | 2 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 2 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 2 | ||||
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 20 | 
4 files changed, 22 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/WinException.cpp b/lib/CodeGen/AsmPrinter/WinException.cpp index 71c77815e281d..a2b9316aa875b 100644 --- a/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/lib/CodeGen/AsmPrinter/WinException.cpp @@ -169,7 +169,7 @@ void WinException::endFunction(const MachineFunction *MF) {      Asm->OutStreamer->PopSection();    } -  if (shouldEmitMoves) +  if (shouldEmitMoves || shouldEmitPersonality)      Asm->OutStreamer->EmitWinCFIEndProc();  } diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 21ab07234c815..fbc8f1e89f6e8 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -439,7 +439,7 @@ ExpandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG,                               ISD::ANY_EXTEND, dl, VT, Result);        ValResult = Result; -      ChainResult = Chain; +      ChainResult = newLoad.getValue(1);        return;      } diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index a7392fabf1e71..54cfaf5706191 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -1010,6 +1010,8 @@ SDValue DAGTypeLegalizer::GetVectorElementPointer(SDValue VecPtr, EVT EltVT,    // Calculate the element offset and add it to the pointer.    unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size. +  assert(EltSize * 8 == EltVT.getSizeInBits() && +         "Converting bits to bytes lost precision");    Index = DAG.getNode(ISD::MUL, dl, Index.getValueType(), Index,                        DAG.getConstant(EltSize, dl, Index.getValueType())); diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 4348ab79f7d19..51cd6619f7833 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -1528,9 +1528,25 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {    if (CustomLowerNode(N, N->getValueType(0), true))      return SDValue(); -  // Store the vector to the stack. -  EVT EltVT = VecVT.getVectorElementType(); +  // Make the vector elements byte-addressable if they aren't already.    SDLoc dl(N); +  EVT EltVT = VecVT.getVectorElementType(); +  if (EltVT.getSizeInBits() < 8) { +    SmallVector<SDValue, 4> ElementOps; +    for (unsigned i = 0; i < VecVT.getVectorNumElements(); ++i) { +      ElementOps.push_back(DAG.getAnyExtOrTrunc( +          DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, Vec, +                      DAG.getConstant(i, dl, MVT::i8)), +          dl, MVT::i8)); +    } + +    EltVT = MVT::i8; +    VecVT = EVT::getVectorVT(*DAG.getContext(), EltVT, +                             VecVT.getVectorNumElements()); +    Vec = DAG.getNode(ISD::BUILD_VECTOR, dl, VecVT, ElementOps); +  } + +  // Store the vector to the stack.    SDValue StackPtr = DAG.CreateStackTemporary(VecVT);    SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr,                                 MachinePointerInfo(), false, false, 0);  | 
