diff options
author | Dale Johannesen <dalej@apple.com> | 2009-03-19 18:03:56 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-03-19 18:03:56 +0000 |
commit | 2050968df96a25a202c00d8e788a57c16e732188 (patch) | |
tree | 1e06039b303499c20455f12bdd1c1ea399bfd1c3 /llvm/lib/Transforms/IPO/PruneEH.cpp | |
parent | 403c4680655de7ef3213ed47a2bf83614e4d9085 (diff) | |
download | bcm5719-llvm-2050968df96a25a202c00d8e788a57c16e732188.tar.gz bcm5719-llvm-2050968df96a25a202c00d8e788a57c16e732188.zip |
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.
llvm-svn: 67311
Diffstat (limited to 'llvm/lib/Transforms/IPO/PruneEH.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/PruneEH.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/PruneEH.cpp b/llvm/lib/Transforms/IPO/PruneEH.cpp index c7a4b9766a5..2b52f464b67 100644 --- a/llvm/lib/Transforms/IPO/PruneEH.cpp +++ b/llvm/lib/Transforms/IPO/PruneEH.cpp @@ -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())); |