diff --git a/sycl/include/sycl/ext/intel/esimd/memory.hpp b/sycl/include/sycl/ext/intel/esimd/memory.hpp index 9a8917504f011..722a7f04e2cf9 100644 --- a/sycl/include/sycl/ext/intel/esimd/memory.hpp +++ b/sycl/include/sycl/ext/intel/esimd/memory.hpp @@ -14257,7 +14257,10 @@ mask_expand_load(const T *p, simd_mask mask, PropertyListT props = {}) { // becomes an index for compressed store/expanded load operation. simd offset = cbit(simd(offsets::value) & pack_mask(mask)); - return gather(p, offset * sizeof(T), mask, props); + simd pass_thru = 0; + simd res = gather(p, offset * sizeof(T), mask, props); + res.merge(pass_thru, !mask); + return res; } /// template mask, // becomes an index for compressed store/expanded load operation. simd offset = cbit(simd(offsets::value) & pack_mask(mask)); - return gather(acc, offset * sizeof(T) + global_offset, mask, props); + simd pass_thru = 0; + simd res = + gather(acc, offset * sizeof(T) + global_offset, mask, props); + res.merge(pass_thru, !mask); + return res; } /// template