summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-02-21 20:36:21 +0000
committerDehao Chen <dehao@google.com>2017-02-21 20:36:21 +0000
commit7810d4fbd0423d98e3a9dd9b8b10a5aa1379b684 (patch)
tree01e355160b8fe07543e76b76b12c00e044d811f0
parent9227e108eb8f5cf4ed9d7b2591daa53e95f9aa6c (diff)
downloadbcm5719-llvm-7810d4fbd0423d98e3a9dd9b8b10a5aa1379b684.tar.gz
bcm5719-llvm-7810d4fbd0423d98e3a9dd9b8b10a5aa1379b684.zip
Only enable AddDiscriminator pass when -fdebug-info-for-profiling is true
Summary: AddDiscriminator pass is only useful for sample pgo. This patch restricts AddDiscriminator to -fdebug-info-for-profiling so that it does not introduce unecessary debug size increases for non-sample-pgo builds. Reviewers: dblaikie, aprantl Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30220 llvm-svn: 295764
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp6
-rw-r--r--clang/test/CodeGenObjC/arc-linetable-autorelease.m5
2 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index a1ec52a3f69..f0e0b71ddfc 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -339,8 +339,10 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
if (TM)
TM->adjustPassManager(PMBuilder);
- PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
- addAddDiscriminatorsPass);
+ if (CodeGenOpts.DebugInfoForProfiling ||
+ !CodeGenOpts.SampleProfileFile.empty())
+ PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
+ addAddDiscriminatorsPass);
// In ObjC ARC mode, add the main ARC optimization passes.
if (LangOpts.ObjCAutoRefCount) {
diff --git a/clang/test/CodeGenObjC/arc-linetable-autorelease.m b/clang/test/CodeGenObjC/arc-linetable-autorelease.m
index 26a779b8d6d..6812e8a6de8 100644
--- a/clang/test/CodeGenObjC/arc-linetable-autorelease.m
+++ b/clang/test/CodeGenObjC/arc-linetable-autorelease.m
@@ -30,11 +30,10 @@ NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h);
// CHECK: define {{.*}}_createBezierPathWithWidth
// CHECK: load {{.*}} %path, align {{.*}}, !dbg ![[RET:[0-9]+]]
// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC:[0-9]+]]
- // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC1:[0-9]+]]
+ // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC]]
// CHECK: ret {{.*}} !dbg ![[ARC]]
// CHECK: ![[RET]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}})
return path;
- // CHECK: ![[ARC]] = !DILocation(line: [[@LINE+2]], scope: !{{.*}})
- // CHECK: ![[ARC1]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}})
+ // CHECK: ![[ARC]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}})
}
@end
OpenPOWER on IntegriCloud