Skip to content

Commit a0f688f

Browse files
authored
[ESIMD][NFC] Remove few unused intrinsics, follow-up NFC for #11545 (#11594)
Signed-off-by: Vyacheslav N Klochkov <[email protected]>
1 parent 4edeb64 commit a0f688f

File tree

5 files changed

+85
-254
lines changed

5 files changed

+85
-254
lines changed

llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,6 @@ class ESIMDIntrinDescTable {
358358
{"svm_scatter4_scaled",
359359
{"svm.scatter4.scaled", {ai1(2), t(2), c16(0), c64(0), a(0), a(1)}}},
360360

361-
// intrinsics to query thread's coordinates:
362-
{"group_id_x", {"group.id.x", {}}},
363-
{"group_id_y", {"group.id.y", {}}},
364-
{"group_id_z", {"group.id.z", {}}},
365-
{"local_id", {"local.id", {}}},
366-
{"local_size", {"local.size", {}}},
367361
{"svm_atomic0", {"svm.atomic", {ai1(1), a(0), u(-1)}, bo(0)}},
368362
{"svm_atomic1", {"svm.atomic", {ai1(2), a(0), a(1), u(-1)}, bo(0)}},
369363
{"svm_atomic2",
@@ -405,25 +399,6 @@ class ESIMDIntrinDescTable {
405399
// arg2: data to write (overloaded)
406400
{"oword_st", {"oword.st", {aSI(0), a(1), a(2)}}},
407401

408-
// surface index-based gather/scatter:
409-
// arg0: i32 log2 num blocks, CONSTANT (0/1/2 for num blocks 1/2/4)
410-
// arg1: i16 scale, CONSTANT
411-
// arg2: i32 surface index
412-
// arg3: i32 global offset in bytes
413-
// arg4: vXi32 element offset in bytes (overloaded)
414-
{"gather_scaled2",
415-
{"gather.scaled2", {t(3), t(4), aSI(0), a(1), a(2)}}},
416-
417-
// arg0: vXi1 predicate (overloaded)
418-
// arg1: i32 log2 num blocks, CONSTANT (0/1/2 for num blocks 1/2/4)
419-
// arg2: i16 scale, CONSTANT
420-
// arg3: i32 surface index
421-
// arg4: i32 global offset in bytes
422-
// arg5: vXi32 element offset in bytes (overloaded)
423-
// arg6: old value of the data read
424-
{"gather_scaled",
425-
{"gather.scaled", {ai1(0), t(3), t(4), aSI(1), a(2), a(3), u(-1)}}},
426-
427402
// arg0: i32 log2 num blocks, CONSTANT (0/1/2 for num blocks 1/2/4)
428403
// arg1: i16 scale, CONSTANT
429404
// arg2: i32 surface index

sycl/include/sycl/ext/intel/esimd/detail/memory_intrin.hpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ __esimd_svm_block_st(__ESIMD_DNS::vector_type_t<Ty, N> *addr,
197197
/// @tparam VS is the number of elements to load per address.
198198
/// @tparam Transposed indicates if the data is transposed during the transfer.
199199
/// @tparam N is the SIMD size of operation (the number of addresses to access)
200-
/// @tparam SurfIndAliasTy is the \ref sycl::accessor type.
200+
/// @tparam SurfIndAliasT is the \ref sycl::accessor type.
201201
/// @param pred is predicates.
202202
/// @param offsets is the zero-based offsets in bytes.
203203
/// @param surf_ind is the surface index.
@@ -268,43 +268,6 @@ __ESIMD_INTRIN void __esimd_svm_scatter4_scaled(
268268
}
269269
#endif // __SYCL_DEVICE_ONLY__
270270

271-
// Low-level surface-based gather. Collects elements located at given offsets in
272-
// a surface and returns them as a single \ref simd object. Element can be
273-
// 1, 2 or 4-byte value, but is always returned as a 4-byte value within the
274-
// resulting simd object, with upper 2 or 3 bytes undefined.
275-
// Template (compile-time constant) parameters:
276-
// @tparam Ty - element type; can only be a 4-byte integer or \c float,
277-
// @tparam N - the number of elements
278-
// @tparam SurfIndAliasTy - "surface index alias" type - internal type in the
279-
// accessor used to denote the surface
280-
// @tparam TySizeLog2 - Log2 of the number of bytes read per element:
281-
// 0 - 1 byte, 1 - 2 bytes, 2 - 4 bytes
282-
// @tparam Scale - offset scaling factor; must be zero currently
283-
// @tparam L1H - L1 cache hint
284-
// @tparam L2H - L2 cache hint
285-
//
286-
// Formal parameters:
287-
// @param surf_ind - the surface index, taken from the SYCL memory object
288-
// @param global_offset - offset added to each individual element's offset to
289-
// compute actual memory access offset for that element
290-
// @param elem_offsets - per-element offsets
291-
//
292-
template <typename Ty, int N, typename SurfIndAliasTy, int TySizeLog2,
293-
int16_t Scale = 0>
294-
__ESIMD_INTRIN __ESIMD_DNS::vector_type_t<Ty, N>
295-
__esimd_gather_scaled2(SurfIndAliasTy surf_ind, uint32_t global_offset,
296-
__ESIMD_DNS::vector_type_t<uint32_t, N> elem_offsets)
297-
#ifdef __SYCL_DEVICE_ONLY__
298-
;
299-
#else
300-
{
301-
static_assert(N == 1 || N == 8 || N == 16 || N == 32);
302-
static_assert(TySizeLog2 <= 2 && Scale == 0);
303-
static_assert(std::is_integral_v<Ty> || TySizeLog2 == 2);
304-
__ESIMD_UNSUPPORTED_ON_HOST;
305-
}
306-
#endif // __SYCL_DEVICE_ONLY__
307-
308271
// Low-level surface-based scatter. Writes elements of a \ref simd object into a
309272
// surface at given offsets. Element can be a 1, 2 or 4-byte value, but it is
310273
// always represented as a 4-byte value within the input simd object,
@@ -317,8 +280,6 @@ __esimd_gather_scaled2(SurfIndAliasTy surf_ind, uint32_t global_offset,
317280
// @tparam TySizeLog2 - Log2 of the number of bytes written per element:
318281
// 0 - 1 byte, 1 - 2 bytes, 2 - 4 bytes
319282
// @tparam Scale - offset scale; only 0 is supported for now
320-
// @tparam L1H - L1 cache hint
321-
// @tparam L2H - L2 cache hint
322283
//
323284
// Formal parameters:
324285
// @param pred - per-element predicates; elements with zero corresponding
@@ -416,21 +377,6 @@ __ESIMD_INTRIN void __esimd_fence(uint8_t cntl)
416377
}
417378
#endif // __SYCL_DEVICE_ONLY__
418379

419-
// Scaled gather from a surface.
420-
template <typename Ty, int N, typename SurfIndAliasTy, int TySizeLog2,
421-
int16_t Scale = 0>
422-
__ESIMD_INTRIN __ESIMD_DNS::vector_type_t<Ty, N>
423-
__esimd_gather_scaled(__ESIMD_DNS::simd_mask_storage_t<N> pred,
424-
SurfIndAliasTy surf_ind, uint32_t global_offset,
425-
__ESIMD_DNS::vector_type_t<uint32_t, N> addrs)
426-
#ifdef __SYCL_DEVICE_ONLY__
427-
;
428-
#else
429-
{
430-
__ESIMD_UNSUPPORTED_ON_HOST;
431-
}
432-
#endif // __SYCL_DEVICE_ONLY__
433-
434380
// Predicated (masked) scaled gather from a surface.
435381
//
436382
// Template (compile-time constant) parameters:

sycl/include/sycl/ext/intel/esimd/memory.hpp

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ scatter(Tx *p, Toffset offset, simd<Tx, N> vals, simd_mask<N> mask = 1) {
225225

226226
namespace detail {
227227
// Accessors may get either 32-bit offset or 64-bit depending on
228-
// the -fsycl-esimd-force-stateles-mem mode settigs.
228+
// the -fsycl-esimd-force-stateles-mem mode setting.
229229
#ifdef __ESIMD_FORCE_STATELESS_MEM
230230
using DeviceAccessorOffsetT = uint64_t;
231231
#else
@@ -394,7 +394,6 @@ block_load_impl(const T *p, simd_mask<1> pred, simd<T, NElts> pass_thru,
394394
///
395395
/// @tparam T is element type.
396396
/// @tparam NElts is the number of elements to load per address.
397-
/// @tparam DS is the data size.
398397
/// @tparam L1H is L1 cache hint.
399398
/// @tparam L2H is L2 cache hint.
400399
/// @tparam AccessorT is the \ref sycl::accessor type.
@@ -1455,13 +1454,8 @@ __ESIMD_API std::enable_if_t<
14551454
sycl::detail::acc_properties::is_accessor_v<AccessorTy> &&
14561455
!sycl::detail::acc_properties::is_local_accessor_v<AccessorTy>,
14571456
simd<T, N>>
1458-
gather(AccessorTy acc,
1459-
#ifdef __ESIMD_FORCE_STATELESS_MEM
1460-
simd<uint64_t, N> offsets, uint64_t glob_offset = 0,
1461-
#else
1462-
simd<uint32_t, N> offsets, uint32_t glob_offset = 0,
1463-
#endif
1464-
simd_mask<N> mask = 1) {
1457+
gather(AccessorTy acc, simd<detail::DeviceAccessorOffsetT, N> offsets,
1458+
detail::DeviceAccessorOffsetT glob_offset = 0, simd_mask<N> mask = 1) {
14651459
#ifdef __ESIMD_FORCE_STATELESS_MEM
14661460
return gather<T, N>(__ESIMD_DNS::accessorToPointer<T>(acc, glob_offset),
14671461
offsets, mask);
@@ -1508,18 +1502,8 @@ __ESIMD_API std::enable_if_t<
15081502
(sizeof(T) <= 4) && (N == 1 || N == 8 || N == 16 || N == 32) &&
15091503
sycl::detail::acc_properties::is_accessor_v<AccessorTy> &&
15101504
!sycl::detail::acc_properties::is_local_accessor_v<AccessorTy>>
1511-
scatter(AccessorTy acc,
1512-
#ifdef __ESIMD_FORCE_STATELESS_MEM
1513-
simd<uint64_t, N> offsets,
1514-
#else
1515-
simd<uint32_t, N> offsets,
1516-
#endif
1517-
simd<T, N> vals,
1518-
#ifdef __ESIMD_FORCE_STATELESS_MEM
1519-
uint64_t glob_offset = 0,
1520-
#else
1521-
uint32_t glob_offset = 0,
1522-
#endif
1505+
scatter(AccessorTy acc, simd<detail::DeviceAccessorOffsetT, N> offsets,
1506+
simd<T, N> vals, detail::DeviceAccessorOffsetT glob_offset = 0,
15231507
simd_mask<N> mask = 1) {
15241508
#ifdef __ESIMD_FORCE_STATELESS_MEM
15251509
scatter<T, N>(__ESIMD_DNS::accessorToPointer<T>(acc, glob_offset), offsets,
@@ -1801,12 +1785,8 @@ __ESIMD_API std::enable_if_t<
18011785
!std::is_pointer_v<AccessorT> &&
18021786
!sycl::detail::acc_properties::is_local_accessor_v<AccessorT>),
18031787
simd<T, N * get_num_channels_enabled(RGBAMask)>>
1804-
gather_rgba(AccessorT acc,
1805-
#ifdef __ESIMD_FORCE_STATELESS_MEM
1806-
simd<uint64_t, N> offsets, uint64_t global_offset = 0,
1807-
#else
1808-
simd<uint32_t, N> offsets, uint32_t global_offset = 0,
1809-
#endif
1788+
gather_rgba(AccessorT acc, simd<detail::DeviceAccessorOffsetT, N> offsets,
1789+
detail::DeviceAccessorOffsetT global_offset = 0,
18101790
simd_mask<N> mask = 1) {
18111791
#ifdef __ESIMD_FORCE_STATELESS_MEM
18121792
return gather_rgba<RGBAMask>(
@@ -1858,18 +1838,9 @@ __ESIMD_API std::enable_if_t<
18581838
(N == 8 || N == 16 || N == 32) && sizeof(T) == 4 &&
18591839
!std::is_pointer_v<AccessorT> &&
18601840
!sycl::detail::acc_properties::is_local_accessor_v<AccessorT>>
1861-
scatter_rgba(AccessorT acc,
1862-
#ifdef __ESIMD_FORCE_STATELESS_MEM
1863-
simd<uint64_t, N> offsets,
1864-
#else
1865-
simd<uint32_t, N> offsets,
1866-
#endif
1841+
scatter_rgba(AccessorT acc, simd<detail::DeviceAccessorOffsetT, N> offsets,
18671842
simd<T, N * get_num_channels_enabled(RGBAMask)> vals,
1868-
#ifdef __ESIMD_FORCE_STATELESS_MEM
1869-
uint64_t global_offset = 0,
1870-
#else
1871-
uint32_t global_offset = 0,
1872-
#endif
1843+
detail::DeviceAccessorOffsetT global_offset = 0,
18731844
simd_mask<N> mask = 1) {
18741845
detail::validate_rgba_write_channel_mask<RGBAMask>();
18751846
#ifdef __ESIMD_FORCE_STATELESS_MEM

0 commit comments

Comments
 (0)