From: Yaron Keren Date: Sun, 19 Jul 2015 11:52:02 +0000 (+0000) Subject: De-duplicate CS.getCalledFunction() expression. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3c6839f477ed13a12eb6986ebf97274b6f3772f5;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242641 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 5273c3dc3ca..0509eed283c 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/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));