[llvm] r292840 - Revert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)"

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 14:40:08 PST 2017


Author: eugenis
Date: Mon Jan 23 16:40:08 2017
New Revision: 292840

URL: http://llvm.org/viewvc/llvm-project?rev=292840&view=rev
Log:
Revert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)"

Causes MSan failures on the buildbot.

Modified:
    llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp

Modified: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp?rev=292840&r1=292839&r2=292840&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp Mon Jan 23 16:40:08 2017
@@ -651,9 +651,9 @@ bool SampleProfileLoader::inlineHotFunct
       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 '") +




More information about the llvm-commits mailing list