Skip to content

Commit

Permalink
HCC: Always produce one-as syncscopes until optimization in the backe…
Browse files Browse the repository at this point in the history
…nd is implemented

Change-Id: I68d0b58824c75b5780a38f014a8246c8cea6ddda
  • Loading branch information
kzhuravl authored and searlmc1 committed May 23, 2019
1 parent eb01e3b commit f3769ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/CodeGen/TargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8003,7 +8003,17 @@ AMDGPUTargetCodeGenInfo::getLLVMSyncScopeID(const LangOptions &LangOpts,
Name = "wavefront";
}

if (Ordering != llvm::AtomicOrdering::SequentiallyConsistent) {
// FIXME: It is incorrect for HIP and HCC to use one-as since
// it appears their memory model has a single happens-before
// relation across all address spaces. However, the recent fix
// in the backend to produce correct code has caused a
// performance regression in HIP/HCC. This can be mitigated by
// a backend optimization that is planned. Until that is
// implemented, this change makes HIP/HCC continue to generate
// the incorrect code. This will only break code that relies
// on a single happens-before between address spaces.
if (!LangOpts.OpenCL ||
Ordering != llvm::AtomicOrdering::SequentiallyConsistent) {
if (!Name.empty())
Name = Twine(Twine(Name) + Twine("-")).str();

Expand Down

0 comments on commit f3769ef

Please sign in to comment.