# Node ID d879687daa1c783b0581738f701cfc0f9700d165 # Parent 86fc0355e9934df44f83e29a6ea31af1c30613ba diff --git a/src/arch/hsail/insts/mem_impl.hh b/src/arch/hsail/insts/mem_impl.hh --- a/src/arch/hsail/insts/mem_impl.hh +++ b/src/arch/hsail/insts/mem_impl.hh @@ -240,19 +240,17 @@ // (the compiler currently generates global access for private // addresses (starting from 0). We need to add the private offset) for (int lane = 0; lane < VSZ; ++lane) { - if (m->addr[lane] < w->privSizePerItem) { - if (mask[lane]) { - // what is the size of the object we are accessing? - // find base for for this wavefront + if (mask[lane] && m->addr[lane] < w->privSizePerItem) { + // what is the size of the object we are accessing? + // find base for for this wavefront - // calcPrivAddr will fail if accesses are unaligned - assert(!((sizeof(MemCType) - 1) & m->addr[lane])); + // calcPrivAddr will fail if accesses are unaligned + assert(!((sizeof(MemCType) - 1) & m->addr[lane])); - Addr privAddr = calcPrivAddr(m->addr[lane], w, lane, - this); + Addr privAddr = calcPrivAddr(m->addr[lane], w, lane, + this); - m->addr[lane] = privAddr; - } + m->addr[lane] = privAddr; } }