Skip to content

Commit 121b810

Browse files
weiyu-chensys_zuul
authored and
sys_zuul
committed
[Autobackout][FuncReg]Revert of change: 07409ae
Flush L3 for device or cross-device memory fence on global memory. Change-Id: Ibefed5c1e1b5b5b327779224f3f7b2ab91fdd4f9
1 parent 803061c commit 121b810

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

IGC/BiFModule/Implementation/atomics.cl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5454
#define FENCE_PRE_OP(Scope, Semantics, isGlobal) \
5555
if( ( (Semantics) & ( SEMANTICS_PRE_OP_NEED_FENCE ) ) > 0 ) \
5656
{ \
57-
bool flushL3 = (isGlobal) && ((Scope) == Device || (Scope) == CrossDevice); \
58-
__builtin_IB_memfence(true, flushL3, false, false, false, isGlobal, false); \
57+
__builtin_IB_memfence(true, false, false, false, false, isGlobal, false); \
5958
}
6059

6160
#define FENCE_POST_OP(Scope, Semantics, isGlobal) \
6261
if( ( (Semantics) & ( SEMANTICS_POST_OP_NEEDS_FENCE ) ) > 0 ) \
6362
{ \
64-
bool flushL3 = (isGlobal) && ((Scope) == Device || (Scope) == CrossDevice); \
65-
__builtin_IB_memfence(true, flushL3, false, false, false, isGlobal, false); \
63+
__builtin_IB_memfence(true, false, false, false, false, isGlobal, false); \
6664
}
6765

6866
// This fencing scheme allows us to obey the memory model when coherency is

IGC/BiFModule/Implementation/barrier.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ static void __intel_atomic_work_item_fence( Scope_t Memory, uint Semantics )
4747
}
4848
else if( Semantics & ( CrossWorkgroupMemory | WorkgroupMemory ) )
4949
{
50-
// A global/local opencl fence requires a hardware fence
50+
// A global/local opencl fence requires a hardware fence,
51+
// but no L3 flush needed.
5152
// We let the code generation decide whether we can elide local fences or not,
5253
// so we need to pass the CLK_GLOBAL flag forward
53-
bool flushL3 = Memory == Device || Memory == CrossDevice;
54-
__builtin_IB_memfence(true, flushL3, false, false, false, Semantics & CrossWorkgroupMemory, invalidateL1);
54+
__builtin_IB_memfence(true, false, false, false, false, Semantics & CrossWorkgroupMemory, invalidateL1);
5555
}
5656
}
5757
}

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13445,11 +13445,6 @@ void EmitPass::emitMemoryFence(llvm::Instruction* inst)
1344513445
bool L3_Flush_Instructions = llvm::cast<llvm::ConstantInt>((inst->getOperand(4)))->getValue().getBoolValue();
1344613446
bool Global_Mem_Fence = true;
1344713447
bool L1_Invalidate = llvm::cast<llvm::ConstantInt>((inst->getOperand(6)))->getValue().getBoolValue() && ctx->platform.hasL1ReadOnlyCache();
13448-
if (L3_Flush_RW_Data)
13449-
{
13450-
// dont flush L1 if L3 is also being flushed
13451-
L1_Invalidate = false;
13452-
}
1345313448

1345413449
bool EmitFence = true;
1345513450
// If passed a non-constant parameter, be conservative and emit a fence.

0 commit comments

Comments
 (0)