parent
f782ebc0cb
commit
92c11e90c8
|
@ -3181,27 +3181,17 @@ static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, DebugLoc dl,
|
||||||
} else {
|
} else {
|
||||||
// The type might not be legal for the target. This should only happen
|
// The type might not be legal for the target. This should only happen
|
||||||
// if the type is smaller than a legal type, as on PPC, so the right
|
// if the type is smaller than a legal type, as on PPC, so the right
|
||||||
// thing to do is generate a LoadExt/StoreTrunc pair.
|
// thing to do is generate a LoadExt/StoreTrunc pair. These simplify
|
||||||
|
// to Load/Store if NVT==VT.
|
||||||
// FIXME does the case above also need this?
|
// FIXME does the case above also need this?
|
||||||
if (TLI.isTypeLegal(VT)) {
|
MVT NVT = TLI.getTypeToTransformTo(VT);
|
||||||
Value = DAG.getLoad(VT, dl, Chain,
|
assert(NVT.bitsGE(VT));
|
||||||
getMemBasePlusOffset(Src, SrcOff, DAG),
|
Value = DAG.getExtLoad(ISD::EXTLOAD, dl, NVT, Chain,
|
||||||
SrcSV, SrcSVOff + SrcOff, false, Align);
|
getMemBasePlusOffset(Src, SrcOff, DAG),
|
||||||
Store = DAG.getStore(Chain, dl, Value,
|
SrcSV, SrcSVOff + SrcOff, VT, false, Align);
|
||||||
|
Store = DAG.getTruncStore(Chain, dl, Value,
|
||||||
getMemBasePlusOffset(Dst, DstOff, DAG),
|
getMemBasePlusOffset(Dst, DstOff, DAG),
|
||||||
DstSV, DstSVOff + DstOff, false, DstAlign);
|
DstSV, DstSVOff + DstOff, VT, false, DstAlign);
|
||||||
} else {
|
|
||||||
MVT NVT = VT;
|
|
||||||
while (!TLI.isTypeLegal(NVT)) {
|
|
||||||
NVT = (MVT::SimpleValueType(NVT.getSimpleVT() + 1));
|
|
||||||
}
|
|
||||||
Value = DAG.getExtLoad(ISD::EXTLOAD, dl, NVT, Chain,
|
|
||||||
getMemBasePlusOffset(Src, SrcOff, DAG),
|
|
||||||
SrcSV, SrcSVOff + SrcOff, VT, false, Align);
|
|
||||||
Store = DAG.getTruncStore(Chain, dl, Value,
|
|
||||||
getMemBasePlusOffset(Dst, DstOff, DAG),
|
|
||||||
DstSV, DstSVOff + DstOff, VT, false, DstAlign);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
OutChains.push_back(Store);
|
OutChains.push_back(Store);
|
||||||
SrcOff += VTSize;
|
SrcOff += VTSize;
|
||||||
|
|
Loading…
Reference in New Issue