Skip to content

Commit 971b72e

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Fix determining independent shared memory fence functionality
This change is to fix the condition when a platform has an independent shared memory fence functionality.
1 parent 8d2757f commit 971b72e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ bool hasSLMFence() const
306306

307307
bool hasIndependentSharedMemoryFenceFunctionality() const
308308
{
309-
return (m_platformInfo.eProductFamily == IGFX_DG2);
309+
return (m_platformInfo.eProductFamily != IGFX_DG2);
310310
}
311311

312312
bool supportRotateInstruction() const { return m_platformInfo.eRenderCoreFamily >= IGFX_GEN11_CORE; }

IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2021 Intel Corporation
3+
Copyright (C) 2021-2023 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -471,8 +471,8 @@ bool SynchronizationObjectCoalescingAnalysis::runOnFunction(llvm::Function& F)
471471
const bool isModified = false; // this is only an analysis
472472
m_CurrentFunction = &F;
473473
const CodeGenContext* const ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
474-
m_HasIndependentSharedMemoryFenceFunctionality = ctx->platform.hasSLMFence() &&
475-
ctx->platform.hasIndependentSharedMemoryFenceFunctionality() &&
474+
m_HasIndependentSharedMemoryFenceFunctionality = !ctx->platform.hasSLMFence() ||
475+
(ctx->platform.hasSLMFence() && ctx->platform.hasIndependentSharedMemoryFenceFunctionality()) ||
476476
IGC_IS_FLAG_ENABLED(EnableIndependentSharedMemoryFenceFunctionality);
477477
m_ShaderType = ctx->type;
478478
m_HasTypedMemoryFenceFunctionality = ctx->platform.hasLSC() && ctx->platform.LSCEnabled();

0 commit comments

Comments
 (0)