[llvm-commits] [llvm] r87035 - /llvm/trunk/lib/Transforms/IPO/Inliner.cpp
Chris Lattner
sabre at nondot.org
Thu Nov 12 13:58:18 PST 2009
Author: lattner
Date: Thu Nov 12 15:58:18 2009
New Revision: 87035
URL: http://llvm.org/viewvc/llvm-project?rev=87035&view=rev
Log:
use isInstructionTriviallyDead, as pointed out by Duncan
Modified:
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=87035&r1=87034&r2=87035&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Thu Nov 12 15:58:18 2009
@@ -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 @@
// 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.
More information about the llvm-commits
mailing list