// Various leaf nodes.
STRING, BasicBlock, VALUETYPE, CONDCODE, Register,
Constant, ConstantFP,
- GlobalAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol,
+ GlobalAddress, GlobalTLSAddress, FrameIndex,
+ JumpTable, ConstantPool, ExternalSymbol,
// The address of the GOT
GLOBAL_OFFSET_TABLE,
// anything else with this node, and this is valid in the target-specific
// dag, turning into a GlobalAddress operand.
TargetGlobalAddress,
+ TargetGlobalTLSAddress,
TargetFrameIndex,
TargetJumpTable,
TargetConstantPool,
/// VINSERT_VECTOR_ELT(VECTOR, VAL, IDX, COUNT,TYPE) - Given a vector
/// VECTOR, an element ELEMENT, and a (potentially variable) index IDX,
- /// return an vector with the specified element of VECTOR replaced with VAL.
+ /// return a vector with the specified element of VECTOR replaced with VAL.
/// COUNT and TYPE specify the type of vector, as is standard for V* nodes.
VINSERT_VECTOR_ELT,
/// Simple abstract vector operators. Unlike the integer and floating point
/// binary operators, these nodes also take two additional operands:
/// a constant element count, and a value type node indicating the type of
- /// the elements. The order is count, type, op0, op1. All vector opcodes,
+ /// the elements. The order is op0, op1, count, type. All vector opcodes,
/// including VLOAD and VConstant must currently have count and type as
/// their last two operands.
VADD, VSUB, VMUL, VSDIV, VUDIV,
TRUNCSTORE,
// DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
- // to a specified boundary. The first operand is the token chain, the
- // second is the number of bytes to allocate, and the third is the alignment
- // boundary. The size is guaranteed to be a multiple of the stack
- // alignment, and the alignment is guaranteed to be bigger than the stack
+ // to a specified boundary. This node always has two return values: a new
+ // stack pointer value and a chain. The first operand is the token chain,
+ // the second is the number of bytes to allocate, and the third is the
+ // alignment boundary. The size is guaranteed to be a multiple of the stack
+ // alignment, and the alignment is guaranteed to be bigger than the stack
// alignment (if required) or 0 to get standard stack alignment.
DYNAMIC_STACKALLOC,
/// getOperationName - Return the opcode of this operation for printing.
///
- const char* getOperationName(const SelectionDAG *G = 0) const;
+ std::string getOperationName(const SelectionDAG *G = 0) const;
static const char* getIndexedModeName(ISD::MemIndexedMode AM);
void dump() const;
void dump(const SelectionDAG *G) const;
protected:
friend class SelectionDAG;
GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
- int o = 0)
- : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress,
- getSDVTList(VT)), Offset(o) {
- TheGlobal = const_cast<GlobalValue*>(GA);
- }
+ int o = 0);
public:
GlobalValue *getGlobal() const { return TheGlobal; }
static bool classof(const GlobalAddressSDNode *) { return true; }
static bool classof(const SDNode *N) {
return N->getOpcode() == ISD::GlobalAddress ||
- N->getOpcode() == ISD::TargetGlobalAddress;
+ N->getOpcode() == ISD::TargetGlobalAddress ||
+ N->getOpcode() == ISD::GlobalTLSAddress ||
+ N->getOpcode() == ISD::TargetGlobalTLSAddress;
}
};
-
class FrameIndexSDNode : public SDNode {
int FI;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
friend class SelectionDAG;
LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
- const Value *SV, int O=0, unsigned Align=1, bool Vol=false)
+ const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
: SDNode(ISD::LOAD, VTs),
AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O),
Alignment(Align), IsVolatile(Vol) {
Ops[1] = ChainPtrOff[1]; // Ptr
Ops[2] = ChainPtrOff[2]; // Off
InitOperands(Ops, 3);
+ assert(Align != 0 && "Loads should have non-zero aligment");
assert((getOffset().getOpcode() == ISD::UNDEF ||
AddrMode != ISD::UNINDEXED) &&
"Only indexed load has a non-undef offset operand");
Ops[2] = ChainValuePtrOff[2]; // Ptr
Ops[3] = ChainValuePtrOff[3]; // Off
InitOperands(Ops, 4);
+ assert(Align != 0 && "Stores should have non-zero aligment");
assert((getOffset().getOpcode() == ISD::UNDEF ||
AddrMode != ISD::UNINDEXED) &&
"Only indexed store has a non-undef offset operand");