summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-10-30 12:40:58 +0000
committerDuncan Sands <baldrick@free.fr>2007-10-30 12:40:58 +0000
commit341f093bb14f134acc231b6af261fdd5f170b6f7 (patch)
treeb45ac15283a0b6fa149b0f577c3a7fff8b409f12 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent4cd61acc330c5b1e179e2479676afb72a47cc490 (diff)
downloadbcm5719-llvm-341f093bb14f134acc231b6af261fdd5f170b6f7.tar.gz
bcm5719-llvm-341f093bb14f134acc231b6af261fdd5f170b6f7.zip
If a call to getTruncStore is for a normal store,
offload to getStore rather than trying to handle both cases at once (the assertions for example assume the store really is truncating). llvm-svn: 43498
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 5b7f1b6e3b8..d92bb9cbd28 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2460,7 +2460,9 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
int SVOffset, MVT::ValueType SVT,
bool isVolatile, unsigned Alignment) {
MVT::ValueType VT = Val.getValueType();
- bool isTrunc = VT != SVT;
+
+ if (VT == SVT)
+ return getStore(Chain, Val, Ptr, SV, SVOffset, isVolatile, Alignment);
assert(MVT::getSizeInBits(VT) > MVT::getSizeInBits(SVT) &&
"Not a truncation?");
@@ -2485,7 +2487,7 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
ID.AddInteger(ISD::UNINDEXED);
- ID.AddInteger(isTrunc);
+ ID.AddInteger(1);
ID.AddInteger((unsigned int)SVT);
ID.AddPointer(SV);
ID.AddInteger(SVOffset);
@@ -2494,7 +2496,7 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Val,
void *IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
return SDOperand(E, 0);
- SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, isTrunc,
+ SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, true,
SVT, SV, SVOffset, Alignment, isVolatile);
CSEMap.InsertNode(N, IP);
AllNodes.push_back(N);
OpenPOWER on IntegriCloud