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
This commit is contained in:
Dehao Chen 2017-01-23 17:09:02 +00:00
parent 274c106a4c
commit e6f6334df4

View File

@ -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 '") +