Rework TD pass to work with the precise call graph constructed by the BU phase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-07-01 16:28:11 +00:00
parent b6734b281b
commit 18f07a11b9
2 changed files with 152 additions and 115 deletions

View File

@ -977,6 +977,7 @@ static inline bool nodeContainsExternalFunction(const DSNode *N) {
}
static void removeIdenticalCalls(std::vector<DSCallSite> &Calls) {
// Remove trivially identical function calls
unsigned NumFns = Calls.size();
std::sort(Calls.begin(), Calls.end()); // Sort by callee as primary key!
@ -1022,6 +1023,7 @@ static void removeIdenticalCalls(std::vector<DSCallSite> &Calls) {
LastCalleeContainsExternalFunction = LastCalleeFunc->isExternal();
}
#if 0
if (LastCalleeContainsExternalFunction ||
// This should be more than enough context sensitivity!
// FIXME: Evaluate how many times this is tripped!
@ -1035,6 +1037,7 @@ static void removeIdenticalCalls(std::vector<DSCallSite> &Calls) {
else if (CS.getNumPtrArgs() > OCS.getNumPtrArgs())
OCS = CS;
}
#endif
} else {
if (CS.isDirectCall()) {
LastCalleeFunc = CS.getCalleeFunc();