diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-11-05 09:30:09 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-11-05 09:30:09 +0000 |
commit | 1a1e23eff7ea16ee3cf54e0bb3fbe8269216e23c (patch) | |
tree | 03610f5b9eab205e79da001cbdabf4632bfd17a1 /llvm/lib/CodeGen | |
parent | 0f43e646f86a4ab82a7400f42f9fe45b2a250e87 (diff) | |
download | bcm5719-llvm-1a1e23eff7ea16ee3cf54e0bb3fbe8269216e23c.tar.gz bcm5719-llvm-1a1e23eff7ea16ee3cf54e0bb3fbe8269216e23c.zip |
Added getIndexedStore.
llvm-svn: 31458
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4c21eff3a6f..6e69728ad33 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1723,6 +1723,36 @@ SDOperand SelectionDAG::getTruncStore(SDOperand Chain, SDOperand Value, return SDOperand(N, 0); } +SDOperand SelectionDAG::getIndexedStore(SDOperand OrigStore, SDOperand Base, + SDOperand Offset, ISD::MemOpAddrMode AM){ + StoreSDNode *ST = cast<StoreSDNode>(OrigStore); + assert(ST->getOffset().getOpcode() == ISD::UNDEF && + "Store is already a indexed store!"); + SDVTList VTs = getVTList(Base.getValueType(), MVT::Other); + SDOperand Ops[] = { ST->getChain(), ST->getValue(), Base, Offset }; + FoldingSetNodeID ID; + AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4); + ID.AddInteger(AM); + ID.AddInteger(ST->isTruncatingStore()); + ID.AddInteger(ST->getStoredVT()); + ID.AddPointer(ST->getSrcValue()); + ID.AddInteger(ST->getSrcValueOffset()); + ID.AddInteger(ST->getAlignment()); + ID.AddInteger(ST->isVolatile()); + void *IP = 0; + if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) + return SDOperand(E, 0); + SDNode *N = new StoreSDNode(ST->getChain(), ST->getValue(), + Base, Offset, AM, + ST->isTruncatingStore(), ST->getStoredVT(), + ST->getSrcValue(), ST->getSrcValueOffset(), + ST->getAlignment(), ST->isVolatile()); + N->setValueTypes(VTs); + CSEMap.InsertNode(N, IP); + AllNodes.push_back(N); + return SDOperand(N, 0); +} + SDOperand SelectionDAG::getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV) { |