[PATCH] D20501: Remove sample profile dependency to instcombine, which is not a analysis pass.
Dehao Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri May 20 17:23:53 PDT 2016
danielcdh created this revision.
danielcdh added a reviewer: davidxl.
danielcdh added a subscriber: llvm-commits.
This patch removes dependency from sample profile pass to instcombine pass.
http://reviews.llvm.org/D20501
Files:
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/calls.ll
test/Transforms/SampleProfile/cov-zero-samples.ll
test/Transforms/SampleProfile/inline-combine.ll
test/Transforms/SampleProfile/inline-coverage.ll
Index: test/Transforms/SampleProfile/inline-coverage.ll
===================================================================
--- test/Transforms/SampleProfile/inline-coverage.ll
+++ test/Transforms/SampleProfile/inline-coverage.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s
;
; Original code:
;
Index: test/Transforms/SampleProfile/inline-combine.ll
===================================================================
--- test/Transforms/SampleProfile/inline-combine.ll
+++ test/Transforms/SampleProfile/inline-combine.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline-combine.prof -S | FileCheck %s
+; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/inline-combine.prof -S | FileCheck %s
%"class.llvm::FoldingSetNodeID" = type { %"class.llvm::SmallVector" }
%"class.llvm::SmallVector" = type { %"class.llvm::SmallVectorImpl.base", %"struct.llvm::SmallVectorStorage" }
Index: test/Transforms/SampleProfile/cov-zero-samples.ll
===================================================================
--- test/Transforms/SampleProfile/cov-zero-samples.ll
+++ test/Transforms/SampleProfile/cov-zero-samples.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/cov-zero-samples.prof -sample-profile-check-record-coverage=100 -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/cov-zero-samples.prof -sample-profile-check-record-coverage=100 -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s
;
; CHECK: remark: cov-zero-samples.cc:9:29: Applied 404065 samples from profile (offset: 2.1)
; CHECK: remark: cov-zero-samples.cc:10:9: Applied 443089 samples from profile (offset: 3)
Index: test/Transforms/SampleProfile/calls.ll
===================================================================
--- test/Transforms/SampleProfile/calls.ll
+++ test/Transforms/SampleProfile/calls.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s
; Original C++ test case
;
Index: lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- lib/Transforms/IPO/SampleProfile.cpp
+++ lib/Transforms/IPO/SampleProfile.cpp
@@ -48,7 +48,6 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/IPO.h"
-#include "llvm/Transforms/InstCombine/InstCombine.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include <cctype>
@@ -122,10 +121,6 @@
bool runOnModule(Module &M) override;
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.addRequired<InstructionCombiningPass>();
- }
-
protected:
bool runOnFunction(Function &F);
unsigned getFunctionLoc(Function &F);
@@ -1218,8 +1213,6 @@
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)
@@ -1263,7 +1256,6 @@
bool SampleProfileLoader::runOnFunction(Function &F) {
F.setEntryCount(0);
- getAnalysis<InstructionCombiningPass>(F);
Samples = Reader->getSamplesFor(F);
if (!Samples->empty())
return emitAnnotations(F);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20501.58020.patch
Type: text/x-patch
Size: 4075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160521/6a601c0c/attachment.bin>
More information about the llvm-commits
mailing list