- /// SelectionDAG, including nodes (like loads) that have uses of their token
- /// chain but no other uses and no side effect. If a node is passed in as an
- /// argument, it is used as the seed for node deletion.
- void RemoveDeadNodes(SDNode *N = 0);
-
- SDOperand getConstant(uint64_t Val, MVT::ValueType VT);
- SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
- SDOperand getConstantFP(double Val, MVT::ValueType VT);
- SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
- SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
- SDOperand getFrameIndex(int FI, MVT::ValueType VT);
- SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT);
- SDOperand getConstantPool(unsigned CPIdx, MVT::ValueType VT);
- SDOperand getTargetConstantPool(unsigned CPIdx, MVT::ValueType VT);
+ /// SelectionDAG.
+ void RemoveDeadNodes();
+
+ /// RemoveDeadNode - Remove the specified node from the system. If any of its
+ /// operands then becomes dead, remove them as well. The vector Deleted is
+ /// populated with nodes that are deleted.
+ void RemoveDeadNode(SDNode *N, std::vector<SDNode*> &Deleted);
+
+ /// DeleteNode - Remove the specified node from the system. This node must
+ /// have no referrers.
+ void DeleteNode(SDNode *N);
+
+ /// getVTList - Return an SDVTList that represents the list of values
+ /// specified.
+ SDVTList getVTList(MVT::ValueType VT);
+ SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2);
+ SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2,MVT::ValueType VT3);
+ SDVTList getVTList(const MVT::ValueType *VTs, unsigned NumVTs);
+
+ /// getNodeValueTypes - These are obsolete, use getVTList instead.
+ const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT) {
+ return getVTList(VT).VTs;
+ }
+ const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,
+ MVT::ValueType VT2) {
+ return getVTList(VT1, VT2).VTs;
+ }
+ const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,MVT::ValueType VT2,
+ MVT::ValueType VT3) {
+ return getVTList(VT1, VT2, VT3).VTs;
+ }
+ const MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &VTList) {
+ return getVTList(&VTList[0], VTList.size()).VTs;
+ }
+
+
+ //===--------------------------------------------------------------------===//
+ // Node creation methods.
+ //
+ SDOperand getString(const std::string &Val);
+ SDOperand getConstant(uint64_t Val, MVT::ValueType VT, bool isTarget = false);
+ SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT) {
+ return getConstant(Val, VT, true);
+ }
+ SDOperand getConstantFP(double Val, MVT::ValueType VT, bool isTarget = false);
+ SDOperand getTargetConstantFP(double Val, MVT::ValueType VT) {
+ return getConstantFP(Val, VT, true);
+ }
+ SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+ int offset = 0, bool isTargetGA = false);
+ SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+ int offset = 0) {
+ return getGlobalAddress(GV, VT, offset, true);
+ }
+ SDOperand getFrameIndex(int FI, MVT::ValueType VT, bool isTarget = false);
+ SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT) {
+ return getFrameIndex(FI, VT, true);
+ }
+ SDOperand getJumpTable(int JTI, MVT::ValueType VT, bool isTarget = false);
+ SDOperand getTargetJumpTable(int JTI, MVT::ValueType VT) {
+ return getJumpTable(JTI, VT, true);
+ }
+ SDOperand getConstantPool(Constant *C, MVT::ValueType VT,
+ unsigned Align = 0, int Offs = 0, bool isT=false);
+ SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT,
+ unsigned Align = 0, int Offset = 0) {
+ return getConstantPool(C, VT, Align, Offset, true);
+ }
+ SDOperand getConstantPool(MachineConstantPoolValue *C, MVT::ValueType VT,
+ unsigned Align = 0, int Offs = 0, bool isT=false);
+ SDOperand getTargetConstantPool(MachineConstantPoolValue *C,
+ MVT::ValueType VT, unsigned Align = 0,
+ int Offset = 0) {
+ return getConstantPool(C, VT, Align, Offset, true);
+ }