mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Add a new SelectionDAG::RemoveDeadNodes method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -93,6 +93,12 @@ public:
|
|||||||
/// the graph.
|
/// the graph.
|
||||||
void Legalize(TargetLowering &TLI);
|
void Legalize(TargetLowering &TLI);
|
||||||
|
|
||||||
|
/// RemoveDeadNodes - This method deletes all unreachable nodes in the
|
||||||
|
/// 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 getConstant(uint64_t Val, MVT::ValueType VT);
|
||||||
SDOperand getConstantFP(double Val, MVT::ValueType VT);
|
SDOperand getConstantFP(double Val, MVT::ValueType VT);
|
||||||
SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
|
SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
|
||||||
@@ -150,6 +156,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void DeleteNodeIfDead(SDNode *N, void *NodeSet);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -409,6 +409,17 @@ protected:
|
|||||||
void setValueTypes(std::vector<MVT::ValueType> &VTs) {
|
void setValueTypes(std::vector<MVT::ValueType> &VTs) {
|
||||||
std::swap(Values, VTs);
|
std::swap(Values, VTs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void removeUser(SDNode *User) {
|
||||||
|
// Remove this user from the operand's use list.
|
||||||
|
for (unsigned i = Uses.size(); ; --i) {
|
||||||
|
assert(i != 0 && "Didn't find user!");
|
||||||
|
if (Uses[i-1] == User) {
|
||||||
|
Uses.erase(Uses.begin()+i-1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -498,7 +509,6 @@ protected:
|
|||||||
GlobalAddressSDNode(const GlobalValue *GA, MVT::ValueType VT)
|
GlobalAddressSDNode(const GlobalValue *GA, MVT::ValueType VT)
|
||||||
: SDNode(ISD::GlobalAddress, VT) {
|
: SDNode(ISD::GlobalAddress, VT) {
|
||||||
TheGlobal = const_cast<GlobalValue*>(GA);
|
TheGlobal = const_cast<GlobalValue*>(GA);
|
||||||
|
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user