From b305ba31c063baa6257826cf133b5f31f9b12dfe Mon Sep 17 00:00:00 2001 From: Victor Mustya Date: Wed, 28 Sep 2022 01:01:37 +0000 Subject: [PATCH] Do not mark scalar globals as volatile . --- .../lib/GenXIntrinsics/GenXSimdCFLowering.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GenXIntrinsics/lib/GenXIntrinsics/GenXSimdCFLowering.cpp b/GenXIntrinsics/lib/GenXIntrinsics/GenXSimdCFLowering.cpp index 9aaa105f..10e44991 100644 --- a/GenXIntrinsics/lib/GenXIntrinsics/GenXSimdCFLowering.cpp +++ b/GenXIntrinsics/lib/GenXIntrinsics/GenXSimdCFLowering.cpp @@ -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(G.getValueType()) && + !G.hasAttribute(genx::FunctionMD::GenXVolatile) && + isGlobalInterseptVol(G, VolList)) { + G.addAttribute(genx::FunctionMD::GenXVolatile); } }