Clear the cached cost when removing a function in

the inliner; prevents nondeterministic behavior
when the same address is reallocated.
Don't build call graph nodes for debug intrinsic calls;
they're useless, and there were typically a lot of them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67311 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen
2009-03-19 18:03:56 +00:00
parent 3751f564e3
commit 1f67ce4aa3
4 changed files with 26 additions and 11 deletions
+5 -3
View File
@@ -20,6 +20,7 @@
#include "llvm/Constants.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
@@ -235,9 +236,10 @@ void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
CallGraphNode *CGN = CG[BB->getParent()];
for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; ) {
--I;
if (CallInst *CI = dyn_cast<CallInst>(I))
CGN->removeCallEdgeFor(CI);
else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
if (CallInst *CI = dyn_cast<CallInst>(I)) {
if (!isa<DbgInfoIntrinsic>(I))
CGN->removeCallEdgeFor(CI);
} else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
CGN->removeCallEdgeFor(II);
if (!I->use_empty())
I->replaceAllUsesWith(UndefValue::get(I->getType()));