diff options
| author | Dehao Chen <dehao@google.com> | 2016-03-01 22:53:02 +0000 |
|---|---|---|
| committer | Dehao Chen <dehao@google.com> | 2016-03-01 22:53:02 +0000 |
| commit | 1012be120a17ca7693624e9ec63e7399d6d5e330 (patch) | |
| tree | 7737c58232dbb0e2b4cdf51503992c9489872d14 /llvm/lib/Transforms/IPO | |
| parent | 2e6a9a290b0edb2bbf06b13004b8082bdf315344 (diff) | |
| download | bcm5719-llvm-1012be120a17ca7693624e9ec63e7399d6d5e330.tar.gz bcm5719-llvm-1012be120a17ca7693624e9ec63e7399d6d5e330.zip | |
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')
| -rw-r--r-- | llvm/lib/Transforms/IPO/SampleProfile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index b8636665a82..97530a577f7 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); |

