Added getIndexedStore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2006-11-05 09:30:09 +00:00
parent 12565159bf
commit 9109fb1eb7
2 changed files with 32 additions and 0 deletions

View File

@ -327,6 +327,8 @@ public:
SDOperand getTruncStore(SDOperand Chain, SDOperand Value, SDOperand Ptr,
const Value *SV, int SVOffset, MVT::ValueType TVT,
bool isVolatile=false);
SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
SDOperand Offset, ISD::MemOpAddrMode AM);
// getSrcValue - construct a node to track a Value* through the backend
SDOperand getSrcValue(const Value* I, int offset = 0);

View File

@ -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) {