Skip to content

Commit

Permalink
Do not mark scalar globals as volatile
Browse files Browse the repository at this point in the history
.
  • Loading branch information
vmustya authored and sys-cmllvm committed Sep 28, 2022
1 parent b2c98d9 commit b305ba3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions GenXIntrinsics/lib/GenXIntrinsics/GenXSimdCFLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,13 @@ void CMSimdCFLowering::initializeVolatileGlobals(Module &M) {
VolList.push_back(&G);
}
}
// If non-volatile global intersept with volatile global
// mark him volatile too
// If non-volatile global vector intercepts with a volatile global mark it
// volatile as well.
for (auto &G : M.getGlobalList()) {
if (!G.hasAttribute(genx::FunctionMD::GenXVolatile)) {
if (isGlobalInterseptVol(G, VolList))
G.addAttribute(genx::FunctionMD::GenXVolatile);
if (isa<VectorType>(G.getValueType()) &&
!G.hasAttribute(genx::FunctionMD::GenXVolatile) &&
isGlobalInterseptVol(G, VolList)) {
G.addAttribute(genx::FunctionMD::GenXVolatile);
}
}

Expand Down

0 comments on commit b305ba3

Please sign in to comment.