Skip to content

Commit 2d03bcd

Browse files
committed
---
yaml --- r: 344894 b: refs/heads/master c: 008c4a0 h: refs/heads/master
1 parent a0f3dcb commit 2d03bcd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: eb42c13dbd1544fa7a8fc5c0377b7d5577ef7acf
2+
refs/heads/master: 008c4a0c0868e6fda6ae550cf73c3b0c63deb833
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/IRGen/IRGen.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,13 @@ void swift::performLLVMOptimizations(IRGenOptions &Opts, llvm::Module *Module,
262262
TargetMachine->getTargetIRAnalysis()));
263263

264264
// If we're generating a profile, add the lowering pass now.
265-
if (Opts.GenerateProfile)
266-
ModulePasses.add(createInstrProfilingLegacyPass());
265+
if (Opts.GenerateProfile) {
266+
// TODO: Surface the option to emit atomic profile counter increments at
267+
// the driver level.
268+
InstrProfOptions Options;
269+
Options.Atomic = bool(Opts.Sanitizers & SanitizerKind::Thread);
270+
ModulePasses.add(createInstrProfilingLegacyPass(Options));
271+
}
267272

268273
PMBuilder.populateModulePassManager(ModulePasses);
269274

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-frontend -emit-ir -profile-generate -sanitize=thread %s | %FileCheck %s
2+
3+
// CHECK: define {{.*}}empty
4+
// CHECK-NOT: load{{.*}}empty
5+
// CHECK: ret void
6+
func empty() {
7+
}
8+
9+
empty()

0 commit comments

Comments
 (0)