From: Evgeniy Stepanov Date: Mon, 23 Jan 2017 22:40:08 +0000 (+0000) Subject: Revert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35de1443fcaaa9e0ddc9681f134ae4fb33d89828;p=llvm Revert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)" Causes MSan failures on the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292840 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/SampleProfile.cpp b/lib/Transforms/IPO/SampleProfile.cpp index 9b280958da8..cba0a813c44 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 '") +