summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-06-24 17:11:31 +0000
committerDale Johannesen <dalej@apple.com>2009-06-24 17:11:31 +0000
commit92c11e90c8d2b8a524750262f9bd6fe492673347 (patch)
tree8a0febcce7c0e3220d0a2511a4659d7c31af7920 /llvm/lib/CodeGen
parentf782ebc0cb384db347cc16d2b9063c4979e09aa1 (diff)
downloadbcm5719-llvm-92c11e90c8d2b8a524750262f9bd6fe492673347.tar.gz
bcm5719-llvm-92c11e90c8d2b8a524750262f9bd6fe492673347.zip
Rewrite 73900 per Duncan's suggestion.
llvm-svn: 74082
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp28
1 files changed, 9 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index ce01d53d60e..aa79089194c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -3181,27 +3181,17 @@ static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, DebugLoc dl,
} else {
// 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
- // 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?
- if (TLI.isTypeLegal(VT)) {
- Value = DAG.getLoad(VT, dl, Chain,
- getMemBasePlusOffset(Src, SrcOff, DAG),
- SrcSV, SrcSVOff + SrcOff, false, Align);
- Store = DAG.getStore(Chain, dl, Value,
+ MVT NVT = TLI.getTypeToTransformTo(VT);
+ assert(NVT.bitsGE(VT));
+ 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, 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);
- }
+ DstSV, DstSVOff + DstOff, VT, false, DstAlign);
}
OutChains.push_back(Store);
SrcOff += VTSize;
OpenPOWER on IntegriCloud