mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user