summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-12 21:58:18 +0000
committerChris Lattner <sabre@nondot.org>2009-11-12 21:58:18 +0000
commit4ff4141a9ee9ce705f2a709f3372acaf58d86ea3 (patch)
tree6901ce23517f28c02c7f1ce701c9a6e40a7ac35b /lib/Transforms/IPO/Inliner.cpp
parentb3bc115a2414a922caa40d5536d8a35ca54e40e3 (diff)
downloadllvm-4ff4141a9ee9ce705f2a709f3372acaf58d86ea3.tar.gz
llvm-4ff4141a9ee9ce705f2a709f3372acaf58d86ea3.tar.bz2
llvm-4ff4141a9ee9ce705f2a709f3372acaf58d86ea3.tar.xz
use isInstructionTriviallyDead, as pointed out by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 0243fe8327..6918fe87c6 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -19,10 +19,11 @@
#include "llvm/IntrinsicInst.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/InlineCost.h"
-#include "llvm/Support/CallSite.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/IPO/InlinerPass.h"
#include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/Transforms/Utils/Local.h"
+#include "llvm/Support/CallSite.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
@@ -344,8 +345,7 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) {
// just delete the call instead of trying to inline it, regardless of
// size. This happens because IPSCCP propagates the result out of the
// call and then we're left with the dead call.
- if (CS.getInstruction()->use_empty() &&
- !CS.getInstruction()->mayHaveSideEffects()) {
+ if (isInstructionTriviallyDead(CS.getInstruction())) {
DEBUG(errs() << " -> Deleting dead call: "
<< *CS.getInstruction() << "\n");
// Update the call graph by deleting the edge from Callee to Caller.