]> gcc.gnu.org Git - gcc.git/commit
Partially support streaming of poly_int for offloading.
authorPrathamesh Kulkarni <prathameshk@nvidia.com>
Wed, 7 Aug 2024 18:15:38 +0000 (23:45 +0530)
committerPrathamesh Kulkarni <prathameshk@nvidia.com>
Wed, 7 Aug 2024 18:18:08 +0000 (23:48 +0530)
commit38900247f3880d6eca2e364a000e5898f8deae64
treebcbbf8ba3e228165386210c0685bbfee661da355
parent165e3e7c3ba884345647c0f1c9a3a57a03383651
Partially support streaming of poly_int for offloading.

When offloading is enabled, the patch streams out host
NUM_POLY_INT_COEFFS, and changes streaming in as follows:

if (host_num_poly_int_coeffs <= NUM_POLY_INT_COEFFS)
{
  for (i = 0; i < host_num_poly_int_coeffs; i++)
    poly_int.coeffs[i] = stream_in coeff;
  for (; i < NUM_POLY_INT_COEFFS; i++)
    poly_int.coeffs[i] = 0;
}
else
{
  for (i = 0; i < NUM_POLY_INT_COEFFS; i++)
    poly_int.coeffs[i] = stream_in coeff;

  /* Ensure that degree of poly_int <= accel NUM_POLY_INT_COEFFS.  */
  for (; i < host_num_poly_int_coeffs; i++)
    {
      val = stream_in coeff;
      if (val != 0)
error ();
    }
}

gcc/ChangeLog:
PR ipa/96265
PR ipa/111937
* data-streamer-in.cc (streamer_read_poly_uint64): Remove code for
streaming, and call poly_int_read_common instead.
(streamer_read_poly_int64): Likewise.
* data-streamer.cc (host_num_poly_int_coeffs): Conditionally define
new variable if ACCEL_COMPILER is defined.
* data-streamer.h (host_num_poly_int_coeffs): Declare.
(poly_int_read_common): New function template.
(bp_unpack_poly_value): Remove code for streaming and call
poly_int_read_common instead.
* lto-streamer-in.cc (lto_input_mode_table): Stream-in host
NUM_POLY_INT_COEFFS into host_num_poly_int_coeffs if ACCEL_COMPILER
is defined.
* lto-streamer-out.cc (lto_write_mode_table): Stream out
NUM_POLY_INT_COEFFS if offloading is enabled.
* poly-int.h (MAX_NUM_POLY_INT_COEFFS_BITS): New macro.
* tree-streamer-in.cc (lto_input_ts_poly_tree_pointers): Adjust
streaming-in of poly_int.

Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com>
gcc/data-streamer-in.cc
gcc/data-streamer.cc
gcc/data-streamer.h
gcc/lto-streamer-in.cc
gcc/lto-streamer-out.cc
gcc/poly-int.h
gcc/tree-streamer-in.cc
This page took 0.057814 seconds and 5 git commands to generate.