aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/SampleProfile.cpp
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-03-01 22:53:02 +0000
committerDehao Chen <dehao@google.com>2016-03-01 22:53:02 +0000
commit1012be120a17ca7693624e9ec63e7399d6d5e330 (patch)
tree7737c58232dbb0e2b4cdf51503992c9489872d14 /llvm/lib/Transforms/IPO/SampleProfile.cpp
parent2e6a9a290b0edb2bbf06b13004b8082bdf315344 (diff)
downloadllvm-1012be120a17ca7693624e9ec63e7399d6d5e330.zip
llvm-1012be120a17ca7693624e9ec63e7399d6d5e330.tar.gz
llvm-1012be120a17ca7693624e9ec63e7399d6d5e330.tar.bz2
Perform InstructioinCombiningPass before SampleProfile pass.
Summary: SampleProfile pass needs to be performed after InstructionCombiningPass, which helps eliminate un-inlinable function calls. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17742 llvm-svn: 262419
Diffstat (limited to 'llvm/lib/Transforms/IPO/SampleProfile.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index b863666..97530a5 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -48,6 +48,7 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/Transforms/InstCombine/InstCombine.h"
#include <cctype>
using namespace llvm;
@@ -121,7 +122,7 @@ public:
bool runOnModule(Module &M) override;
void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesCFG();
+ AU.addRequired<InstructionCombiningPass>();
}
protected:
@@ -1215,6 +1216,7 @@ char SampleProfileLoader::ID = 0;
INITIALIZE_PASS_BEGIN(SampleProfileLoader, "sample-profile",
"Sample Profile loader", false, false)
INITIALIZE_PASS_DEPENDENCY(AddDiscriminators)
+INITIALIZE_PASS_DEPENDENCY(InstructionCombiningPass)
INITIALIZE_PASS_END(SampleProfileLoader, "sample-profile",
"Sample Profile loader", false, false)
@@ -1258,6 +1260,7 @@ bool SampleProfileLoader::runOnModule(Module &M) {
bool SampleProfileLoader::runOnFunction(Function &F) {
F.setEntryCount(0);
+ getAnalysis<InstructionCombiningPass>(F);
Samples = Reader->getSamplesFor(F);
if (!Samples->empty())
return emitAnnotations(F);