Change the ActualCallees callgraph from hash_multimap<Instruction,Function>

to std::set<std::pair<Inst,Func>> to avoid duplicate entries.

This speeds up the CompleteBU pass from 1.99s to .15s on povray and the
eqgraph passes from 1.5s to .16s on the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-04-02 19:17:18 +00:00
parent df968b8b37
commit 021decc82d
5 changed files with 40 additions and 78 deletions

View File

@ -25,11 +25,10 @@ using namespace llvm;
namespace {
class Steens : public ModulePass, public AliasAnalysis {
DSGraph *ResultGraph;
DSGraph *GlobalsGraph; // FIXME: Eliminate globals graph stuff from DNE
EquivalenceClasses<GlobalValue*> GlobalECs; // Always empty
public:
Steens() : ResultGraph(0), GlobalsGraph(0) {}
Steens() : ResultGraph(0) {}
~Steens() {
releaseMyMemory();
assert(ResultGraph == 0 && "releaseMemory not called?");
@ -116,8 +115,7 @@ bool Steens::runOnModule(Module &M) {
// Create a new, empty, graph...
ResultGraph = new DSGraph(GlobalECs, getTargetData());
GlobalsGraph = new DSGraph(GlobalECs, getTargetData());
ResultGraph->setGlobalsGraph(GlobalsGraph);
ResultGraph->spliceFrom(LDS.getGlobalsGraph());
// Loop over the rest of the module, merging graphs for non-external functions
// into this graph.
@ -186,7 +184,7 @@ bool Steens::runOnModule(Module &M) {
// Remove any nodes that are dead after all of the merging we have done...
// FIXME: We should be able to disable the globals graph for steens!
ResultGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
//ResultGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
DEBUG(print(std::cerr, &M));
return false;