Skip to content

Commit 094c73d

Browse files
committed
Set AtomicProfileUpdate in CodeGenOpts
Signed-off-by: Michael Aziz <[email protected]>
1 parent c30c098 commit 094c73d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ getInstrProfOptions(const CodeGenOptions &CodeGenOpts,
601601
Options.InstrProfileOutput = CodeGenOpts.ContinuousProfileSync
602602
? ("%c" + CodeGenOpts.InstrProfileOutput)
603603
: CodeGenOpts.InstrProfileOutput;
604-
Options.Atomic = LangOpts.SYCLIsDevice || CodeGenOpts.AtomicProfileUpdate;
604+
Options.Atomic = CodeGenOpts.AtomicProfileUpdate;
605605
return Options;
606606
}
607607

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5377,6 +5377,8 @@ bool CompilerInvocation::CreateFromArgsImpl(
53775377
if (LangOpts.SYCLIsDevice) {
53785378
// Set the triple of the host for SYCL device compile.
53795379
Res.getTargetOpts().HostTriple = Res.getFrontendOpts().AuxTriple;
5380+
// Set the atomic profile update flag to increment counters atomically.
5381+
Res.getCodeGenOpts().AtomicProfileUpdate = true;
53805382
// If specified, create empty integration header files for now.
53815383
CreateEmptyFile(LangOpts.SYCLIntHeader);
53825384
CreateEmptyFile(LangOpts.SYCLIntFooter);

0 commit comments

Comments
 (0)