diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-06-09 03:29:20 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-06-09 03:29:20 +0000 |
commit | cb9327b02db9a13379bb83b499166aff2930050a (patch) | |
tree | c5c3a1e26665b5a4f82311910a05faacff17bd35 /llvm/lib/Transforms/IPO/Inliner.cpp | |
parent | 365d4d0000ea378748f4090640395c3001df78c4 (diff) | |
download | bcm5719-llvm-cb9327b02db9a13379bb83b499166aff2930050a.tar.gz bcm5719-llvm-cb9327b02db9a13379bb83b499166aff2930050a.zip |
Inliner: Don't touch indirect calls
Other comments/implications are that this isn't intended behavior (nor
perserved/reimplemented in the new inliner) & complicates fixing the
'inlining' of trivially dead calls without consulting the cost function
first.
llvm-svn: 305052
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 673d3af0ab5..c0dfeede05c 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -519,6 +519,10 @@ inlineCallsImpl(CallGraphSCC &SCC, CallGraph &CG, Function *Caller = CS.getCaller(); Function *Callee = CS.getCalledFunction(); + // We can only inline direct calls to non-declarations. + if (!Callee || Callee->isDeclaration()) + continue; + // 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 @@ -531,10 +535,6 @@ inlineCallsImpl(CallGraphSCC &SCC, CallGraph &CG, CS.getInstruction()->eraseFromParent(); ++NumCallsDeleted; } else { - // We can only inline direct calls to non-declarations. - if (!Callee || Callee->isDeclaration()) - continue; - // If this call site was obtained by inlining another function, verify // that the include path for the function did not include the callee // itself. If so, we'd be recursively inlining the same function, |