diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-10-13 21:14:26 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-10-13 21:14:26 +0000 |
| commit | 8b2794aeff151be8cdbd44786c1d0f94f8f2e427 (patch) | |
| tree | 202a27cf2d166d307ef7d547f1b79bc33f33431f /include/llvm/CodeGen | |
| parent | d51c87f22f9b666204b27b301af771bc5badc142 (diff) | |
Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 5 | ||||
| -rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 32 |
2 files changed, 23 insertions, 14 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index ded775f778..2624125783 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -319,7 +319,10 @@ public: /// getStore - Helper function to build ISD::STORE nodes. /// SDOperand getStore(SDOperand Chain, SDOperand Value, SDOperand Ptr, - SDOperand SV); + const Value *SV, int SVOffset, bool isVolatile=false); + SDOperand getTruncStore(SDOperand Chain, SDOperand Value, SDOperand Ptr, + const Value *SV, int SVOffset, MVT::ValueType TVT, + bool isVolatile=false); // getSrcValue - construct a node to track a Value* through the backend SDOperand getSrcValue(const Value* I, int offset = 0); diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 45a01ac883..dea371e889 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1408,15 +1408,6 @@ protected: assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) && "Only post-indexed load has a non-undef offset operand"); } - LoadSDNode(SDOperand Chain, SDOperand Ptr, SDOperand Off, - ISD::LoadExtType ETy, MVT::ValueType LVT, - const Value *SV, int O=0, unsigned Align=1, bool Vol=false) - : SDNode(ISD::LOAD, Chain, Ptr, Off), - AddrMode(ISD::UNINDEXED), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), - SVOffset(O), Alignment(Align), IsVolatile(Vol) { - assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) && - "Only post-indexed load has a non-undef offset operand"); - } public: const SDOperand getChain() const { return getOperand(0); } @@ -1461,10 +1452,10 @@ class StoreSDNode : public SDNode { bool IsVolatile; protected: friend class SelectionDAG; - StoreSDNode(SDOperand Chain, SDOperand Ptr, SDOperand Off, + StoreSDNode(SDOperand Chain, SDOperand Value, SDOperand Ptr, SDOperand Off, ISD::MemOpAddrMode AM, bool isTrunc, MVT::ValueType SVT, const Value *SV, int O=0, unsigned Align=0, bool Vol=false) - : SDNode(ISD::STORE, Chain, Ptr, Off), + : SDNode(ISD::STORE, Chain, Value, Ptr, Off), AddrMode(AM), IsTruncStore(isTrunc), StoredVT(SVT), SrcValue(SV), SVOffset(O), Alignment(Align), IsVolatile(Vol) { assert((Off.getOpcode() == ISD::UNDEF || AddrMode == ISD::POST_INDEXED) && @@ -1473,8 +1464,9 @@ protected: public: const SDOperand getChain() const { return getOperand(0); } - const SDOperand getBasePtr() const { return getOperand(1); } - const SDOperand getOffset() const { return getOperand(2); } + const SDOperand getValue() const { return getOperand(1); } + const SDOperand getBasePtr() const { return getOperand(2); } + const SDOperand getOffset() const { return getOperand(3); } ISD::MemOpAddrMode getAddressingMode() const { return AddrMode; } bool isTruncatingStore() const { return IsTruncStore; } MVT::ValueType getStoredVT() const { return StoredVT; } @@ -1591,6 +1583,20 @@ namespace ISD { return N->getOpcode() == ISD::LOAD && cast<LoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD; } + + /// isNON_TRUNCStore - Returns true if the specified node is a non-truncating + /// store. + inline bool isNON_TRUNCStore(const SDNode *N) { + return N->getOpcode() == ISD::STORE && + !cast<StoreSDNode>(N)->isTruncatingStore(); + } + + /// isTRUNCStore - Returns true if the specified node is a truncating + /// store. + inline bool isTRUNCStore(const SDNode *N) { + return N->getOpcode() == ISD::STORE && + cast<StoreSDNode>(N)->isTruncatingStore(); + } } |
