[llvm] r242641 - De-duplicate CS.getCalledFunction() expression.

Yaron Keren yaron.keren at gmail.com
Sun Jul 19 04:52:02 PDT 2015


Author: yrnkrn
Date: Sun Jul 19 06:52:02 2015
New Revision: 242641

URL: http://llvm.org/viewvc/llvm-project?rev=242641&view=rev
Log:
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.


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=242641&r1=242640&r2=242641&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Sun Jul 19 06:52:02 2015
@@ -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));





More information about the llvm-commits mailing list