Skip to content

Commit 7810d4f

Browse files
committedFeb 21, 2017
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
1 parent 9227e10 commit 7810d4f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎clang/lib/CodeGen/BackendUtil.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,10 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
339339
if (TM)
340340
TM->adjustPassManager(PMBuilder);
341341

342-
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
343-
addAddDiscriminatorsPass);
342+
if (CodeGenOpts.DebugInfoForProfiling ||
343+
!CodeGenOpts.SampleProfileFile.empty())
344+
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
345+
addAddDiscriminatorsPass);
344346

345347
// In ObjC ARC mode, add the main ARC optimization passes.
346348
if (LangOpts.ObjCAutoRefCount) {

‎clang/test/CodeGenObjC/arc-linetable-autorelease.m

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ - (NSBezierPath *)_createBezierPathWithWidth:(CGFloat)width height:(CGFloat)heig
3030
// CHECK: define {{.*}}_createBezierPathWithWidth
3131
// CHECK: load {{.*}} %path, align {{.*}}, !dbg ![[RET:[0-9]+]]
3232
// CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC:[0-9]+]]
33-
// CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC1:[0-9]+]]
33+
// CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC]]
3434
// CHECK: ret {{.*}} !dbg ![[ARC]]
3535
// CHECK: ![[RET]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}})
3636
return path;
37-
// CHECK: ![[ARC]] = !DILocation(line: [[@LINE+2]], scope: !{{.*}})
38-
// CHECK: ![[ARC1]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}})
37+
// CHECK: ![[ARC]] = !DILocation(line: [[@LINE+1]], scope: !{{.*}})
3938
}
4039
@end

0 commit comments

Comments
 (0)
Please sign in to comment.