diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2015-07-19 11:52:02 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2015-07-19 11:52:02 +0000 |
commit | 611f614ee18eb31bf6ba2d0dc61aeb9f0d510bf7 (patch) | |
tree | de5a08646e538fe1ed6605f88159979793ea4775 | |
parent | 4ef0576c404c5f24119421e09867c031d540476a (diff) | |
download | bcm5719-llvm-611f614ee18eb31bf6ba2d0dc61aeb9f0d510bf7.tar.gz bcm5719-llvm-611f614ee18eb31bf6ba2d0dc61aeb9f0d510bf7.zip |
De-duplicate CS.getCalledFunction() expression.
Not sure if the optimizer will save the call as getCalledFunction()
is not a trivial access function but the code is clearer this way.
llvm-svn: 242641
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 5273c3dc3ca..0509eed283c 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -469,7 +469,8 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) { // If this is a direct call to an external function, we can never inline // it. If it is an indirect call, inlining may resolve it to be a // direct call, so we keep it. - if (CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration()) + Function *Callee = CS.getCalledFunction(); + if (Callee && Callee->isDeclaration()) continue; CallSites.push_back(std::make_pair(CS, -1)); |