// 5) ISD::CvtCode indicating the type of conversion to do
CONVERT_RNDSAT,
+ // FP16_TO_FP32, FP32_TO_FP16 - These operators are used to perform
+ // promotions and truncation for half-precision (16 bit) floating
+ // numbers. We need special nodes since FP16 is a storage-only type with
+ // special semantics of operations.
+ FP16_TO_FP32, FP32_TO_FP16,
+
// FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
// FLOG, FLOG2, FLOG10, FEXP, FEXP2,
// FCEIL, FTRUNC, FRINT, FNEARBYINT, FFLOOR - Perform various unary floating
// return values: a chain and a flag result. The inputs are as follows:
// Operand #0 : Input chain.
// Operand #1 : a ExternalSymbolSDNode with a pointer to the asm string.
- // Operand #2n+2: A RegisterNode.
- // Operand #2n+3: A TargetConstant, indicating if the reg is a use/def
+ // Operand #2 : a MDNodeSDNode with the !srcloc metadata.
+ // After this, it is followed by a list of operands with this format:
+ // ConstantSDNode: Flags that encode whether it is a mem or not, the
+ // of operands that follow, etc. See InlineAsm.h.
+ // ... however many operands ...
// Operand #last: Optional, an incoming flag.
+ //
+ // The variable width operands are required to represent target addressing
+ // modes as a single "operand", even though they may have multiple
+ // SDOperands.
INLINEASM,
// EH_LABEL - Represents a label in mid basic block used to track
// SRCVALUE - This is a node type that holds a Value* that is used to
// make reference to a value in the LLVM IR.
SRCVALUE,
+
+ // MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to
+ // reference metadata in the IR.
+ MDNODE_SDNODE,
// PCMARKER - This corresponds to the pcmarker intrinsic.
PCMARKER,
/// which do not reference a specific memory location should be less than
/// this value. Those that do must not be less than this value, and can
/// be used with SelectionDAG::getMemIntrinsicNode.
- static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+80;
+ static const int FIRST_TARGET_MEMORY_OPCODE = BUILTIN_OP_END+100;
/// Node predicates
public:
// FIXME: Remove the "noinline" attribute once <rdar://problem/5852746> is
// fixed.
-#ifdef __GNUC__
+#if __GNUC__==4 && __GNUC_MINOR__==2 && defined(__APPLE__) && !defined(__llvm__)
explicit __attribute__((__noinline__)) HandleSDNode(SDValue X)
#else
explicit HandleSDNode(SDValue X)
#endif
- : SDNode(ISD::HANDLENODE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)) {
+ : SDNode(ISD::HANDLENODE, DebugLoc(), getSDVTList(MVT::Other)) {
InitOperands(&Op, X);
}
~HandleSDNode();
friend class SelectionDAG;
ConstantSDNode(bool isTarget, const ConstantInt *val, EVT VT)
: SDNode(isTarget ? ISD::TargetConstant : ISD::Constant,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), Value(val) {
+ DebugLoc(), getSDVTList(VT)), Value(val) {
}
public:
friend class SelectionDAG;
ConstantFPSDNode(bool isTarget, const ConstantFP *val, EVT VT)
: SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), Value(val) {
+ DebugLoc(), getSDVTList(VT)), Value(val) {
}
public:
friend class SelectionDAG;
FrameIndexSDNode(int fi, EVT VT, bool isTarg)
: SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), FI(fi) {
+ DebugLoc(), getSDVTList(VT)), FI(fi) {
}
public:
friend class SelectionDAG;
JumpTableSDNode(int jti, EVT VT, bool isTarg, unsigned char TF)
: SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) {
+ DebugLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) {
}
public:
ConstantPoolSDNode(bool isTarget, Constant *c, EVT VT, int o, unsigned Align,
unsigned char TF)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- DebugLoc::getUnknownLoc(),
+ DebugLoc(),
getSDVTList(VT)), Offset(o), Alignment(Align), TargetFlags(TF) {
assert((int)Offset >= 0 && "Offset is too large");
Val.ConstVal = c;
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
EVT VT, int o, unsigned Align, unsigned char TF)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- DebugLoc::getUnknownLoc(),
+ DebugLoc(),
getSDVTList(VT)), Offset(o), Alignment(Align), TargetFlags(TF) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
/// blocks out of order when they're jumped to, which makes it a bit
/// harder. Let's see if we need it first.
explicit BasicBlockSDNode(MachineBasicBlock *mbb)
- : SDNode(ISD::BasicBlock, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), MBB(mbb) {
+ : SDNode(ISD::BasicBlock, DebugLoc(), getSDVTList(MVT::Other)), MBB(mbb) {
}
public:
friend class SelectionDAG;
/// Create a SrcValue for a general value.
explicit SrcValueSDNode(const Value *v)
- : SDNode(ISD::SRCVALUE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), V(v) {}
+ : SDNode(ISD::SRCVALUE, DebugLoc(), getSDVTList(MVT::Other)), V(v) {}
public:
/// getValue - return the contained Value.
return N->getOpcode() == ISD::SRCVALUE;
}
};
+
+class MDNodeSDNode : public SDNode {
+ const MDNode *MD;
+ friend class SelectionDAG;
+ explicit MDNodeSDNode(const MDNode *md)
+ : SDNode(ISD::MDNODE_SDNODE, DebugLoc(), getSDVTList(MVT::Other)), MD(md) {}
+public:
+
+ const MDNode *getMD() const { return MD; }
+
+ static bool classof(const MDNodeSDNode *) { return true; }
+ static bool classof(const SDNode *N) {
+ return N->getOpcode() == ISD::MDNODE_SDNODE;
+ }
+};
class RegisterSDNode : public SDNode {
unsigned Reg;
friend class SelectionDAG;
RegisterSDNode(unsigned reg, EVT VT)
- : SDNode(ISD::Register, DebugLoc::getUnknownLoc(),
- getSDVTList(VT)), Reg(reg) {
+ : SDNode(ISD::Register, DebugLoc(), getSDVTList(VT)), Reg(reg) {
}
public:
friend class SelectionDAG;
BlockAddressSDNode(unsigned NodeTy, EVT VT, BlockAddress *ba,
unsigned char Flags)
- : SDNode(NodeTy, DebugLoc::getUnknownLoc(), getSDVTList(VT)),
+ : SDNode(NodeTy, DebugLoc(), getSDVTList(VT)),
BA(ba), TargetFlags(Flags) {
}
public:
friend class SelectionDAG;
ExternalSymbolSDNode(bool isTarget, const char *Sym, unsigned char TF, EVT VT)
: SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
- DebugLoc::getUnknownLoc(),
- getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) {
+ DebugLoc(), getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) {
}
public:
ISD::CondCode Condition;
friend class SelectionDAG;
explicit CondCodeSDNode(ISD::CondCode Cond)
- : SDNode(ISD::CONDCODE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), Condition(Cond) {
+ : SDNode(ISD::CONDCODE, DebugLoc(), getSDVTList(MVT::Other)),
+ Condition(Cond) {
}
public:
EVT ValueType;
friend class SelectionDAG;
explicit VTSDNode(EVT VT)
- : SDNode(ISD::VALUETYPE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), ValueType(VT) {
+ : SDNode(ISD::VALUETYPE, DebugLoc(), getSDVTList(MVT::Other)),
+ ValueType(VT) {
}
public: