summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SampleProfile.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-01-23 17:09:02 +0000
committerDehao Chen <dehao@google.com>2017-01-23 17:09:02 +0000
commita53219a5f2a23e6f7c63359d70a1261a7bd3cf26 (patch)
tree18de290e789608dfb26d426a4703a1c5ebf9c61a /llvm/lib/Transforms/IPO/SampleProfile.cpp
parent8cf0c274040cd4f731860c27fee1f6a7cdb0c69a (diff)
downloadbcm5719-llvm-a53219a5f2a23e6f7c63359d70a1261a7bd3cf26.tar.gz
bcm5719-llvm-a53219a5f2a23e6f7c63359d70a1261a7bd3cf26.zip
Refactor SampleProfile.cpp to move computation inside a branch. (NFC)
llvm-svn: 292803
Diffstat (limited to 'llvm/lib/Transforms/IPO/SampleProfile.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index cba0a813c44..9b280958da8 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/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 '") +
OpenPOWER on IntegriCloud