summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-05-01 08:34:28 +0000
committerOwen Anderson <resistor@mac.com>2010-05-01 08:34:28 +0000
commit1b4a38646f6bbeb32a125a1f2316a7b2d27916d7 (patch)
treeee51964e0c0be1588be20f38b676b63398d5adf9 /lib/Transforms/IPO/Inliner.cpp
parentbccb41afc8542f01358341451cac85a7115d8763 (diff)
downloadllvm-1b4a38646f6bbeb32a125a1f2316a7b2d27916d7.tar.gz
llvm-1b4a38646f6bbeb32a125a1f2316a7b2d27916d7.tar.bz2
llvm-1b4a38646f6bbeb32a125a1f2316a7b2d27916d7.tar.xz
Disable the call-deletion transformation introduced in r86975. Without
halting analysis, it is illegal to delete a call to a read-only function. The correct solution is almost certainly to add a "must halt" attribute and only allow deletions in its presence. XFAIL the relevant testcase for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index b785bb0a93..875c4fd703 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -33,7 +33,8 @@
using namespace llvm;
STATISTIC(NumInlined, "Number of functions inlined");
-STATISTIC(NumCallsDeleted, "Number of call sites deleted, not inlined");
+// FIXME: Uncomment once call deletion xform is made safe
+// STATISTIC(NumCallsDeleted, "Number of call sites deleted, not inlined");
STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
STATISTIC(NumMergedAllocas, "Number of allocas merged together");
@@ -382,6 +383,9 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
Function *Caller = CS.getCaller();
Function *Callee = CS.getCalledFunction();
+ // FIXME: This transformation is not legal unless we can prove
+ // that the callee always terminates.
+#if 0
// If this call site is dead and it is to a readonly function, we should
// just delete the call instead of trying to inline it, regardless of
// size. This happens because IPSCCP propagates the result out of the
@@ -396,6 +400,7 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
// Update the cached cost info with the missing call
growCachedCostInfo(Caller, NULL);
} else {
+#endif
// We can only inline direct calls to non-declarations.
if (Callee == 0 || Callee->isDeclaration()) continue;
@@ -437,7 +442,9 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
// Update the cached cost info with the inlined call.
growCachedCostInfo(Caller, Callee);
+#if 0
}
+#endif
// If we inlined or deleted the last possible call site to the function,
// delete the function body now.