From 4fdec3091f07cf061adc1edd1df9250b470a161b Mon Sep 17 00:00:00 2001 From: gregory Date: Fri, 2 Feb 2024 10:18:46 -0800 Subject: [PATCH 1/2] Make 64 bit data use lsc version of gather implementation --- sycl/include/sycl/ext/intel/esimd/memory.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/ext/intel/esimd/memory.hpp b/sycl/include/sycl/ext/intel/esimd/memory.hpp index 5d8f13ce82619..7e7f0b80759c0 100644 --- a/sycl/include/sycl/ext/intel/esimd/memory.hpp +++ b/sycl/include/sycl/ext/intel/esimd/memory.hpp @@ -3921,7 +3921,7 @@ slm_gather(simd byte_offsets, simd_mask mask, static_assert(Alignment >= sizeof(T), "slm_gather() requires at least element-size alignment"); - if constexpr (VS > 1 || (!detail::isPowerOf2(N, 32) && + if constexpr (VS > 1 || (!(detail::isPowerOf2(N, 32) && sizeof(T) <= 4) && !detail::isMaskedGatherScatterLLVMAvailable())) { simd PassThru; // Intentionally undefined return detail::slm_gather_impl( From 21b606b0c985adc43cd2de76e4f610f75ffc40da Mon Sep 17 00:00:00 2001 From: "Fine, Gregory" Date: Fri, 2 Feb 2024 17:56:56 -0800 Subject: [PATCH 2/2] Add a test --- sycl/test/esimd/memory_properties.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sycl/test/esimd/memory_properties.cpp b/sycl/test/esimd/memory_properties.cpp index 31dbc3e889f4b..936464cd1ff07 100644 --- a/sycl/test/esimd/memory_properties.cpp +++ b/sycl/test/esimd/memory_properties.cpp @@ -1303,4 +1303,9 @@ test_slm_gather_scatter(int byte_offset32) { props_align4); slm = slm_gather(ioffset_n16_view, mask_n16, pass_thru_view, props_align4); + + // Special case to verify calls to slm_gather with 64 bit data type are + // transformed to lsc calls + // CHECK-COUNT-1: call <32 x double> @llvm.masked.gather.v32f64.v32p3(<32 x ptr addrspace(3)> {{[^)]+}}, i32 8, <32 x i1> {{[^)]+}}, <32 x double> {{[^)]+}}) + auto slm_double = slm_gather(ioffset_n32, mask_n32); }