Skip to content

Commit fc02749

Browse files
traoux1paigeale
authored andcommitted
Prevent aliasing between private memory and stateful accesses
Change-Id: I3bdf449e96861aa9f3eea2e92c596bd554d91baa
1 parent b0bde84 commit fc02749

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/AddressSpaceAliasAnalysis/AddressSpaceAliasAnalysis.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ class AddressSpaceAAResult : public AAResultBase<AddressSpaceAAResult> {
8383
return NoAlias;
8484
}
8585

86+
// Private memory doesn't alias any stateful memory
87+
if((AS1 == ADDRESS_SPACE_PRIVATE && AS2 > ADDRESS_SPACE_NUM_ADDRESSES) ||
88+
(AS1 > ADDRESS_SPACE_NUM_ADDRESSES && AS2 == ADDRESS_SPACE_PRIVATE))
89+
{
90+
return NoAlias;
91+
}
92+
8693

8794
/// For some client APIs (e.g. vulkan) compiler is free to assume that
8895
/// resources bound to two different bindings points never alias unless a

0 commit comments

Comments
 (0)