From: Dehao Chen Date: Mon, 23 Jan 2017 17:09:02 +0000 (+0000) Subject: Refactor SampleProfile.cpp to move computation inside a branch. (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6f6334df402e129095a2912fd30025d211b13da;p=llvm Refactor SampleProfile.cpp to move computation inside a branch. (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292803 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/SampleProfile.cpp b/lib/Transforms/IPO/SampleProfile.cpp index cba0a813c44..9b280958da8 100644 --- a/lib/Transforms/IPO/SampleProfile.cpp +++ b/lib/Transforms/IPO/SampleProfile.cpp @@ -651,9 +651,9 @@ bool SampleProfileLoader::inlineHotFunctions(Function &F) { Function *CalledFunction = CS.getCalledFunction(); if (!CalledFunction || !CalledFunction->getSubprogram()) continue; - DebugLoc DLoc = I->getDebugLoc(); - uint64_t NumSamples = findCalleeFunctionSamples(*I)->getTotalSamples(); if (InlineFunction(CS, IFI)) { + DebugLoc DLoc = I->getDebugLoc(); + uint64_t NumSamples = findCalleeFunctionSamples(*I)->getTotalSamples(); LocalChanged = true; emitOptimizationRemark(Ctx, DEBUG_TYPE, F, DLoc, Twine("inlined hot callee '") +