[all-commits] [llvm/llvm-project] 8e447a: [libc] Optimize the RPC memory copy for the AMDGPU...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Oct 27 12:55:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e447a123b0006b4c14fcb61049559039b3da32f
      https://github.com/llvm/llvm-project/commit/8e447a123b0006b4c14fcb61049559039b3da32f
  Author: Joseph Huber <35342157+jhuber6 at users.noreply.github.com>
  Date:   2023-10-27 (Fri, 27 Oct 2023)

  Changed paths:
    M libc/src/__support/RPC/rpc.h
    M libc/src/__support/RPC/rpc_util.h

  Log Message:
  -----------
  [libc] Optimize the RPC memory copy for the AMDGPU target (#70467)

Summary:
We previously made the change to make the GPU target use builtin
implementations of memory copy functions. However, this had the negative
effect of massively increasing register usages when using the printing
interface. For example, a `printf` call went from using 25 VGPRs to 54
simply because of using the builtin. However, we probably want to still
export the builitin, but for the RPC interface we heavily prefer small
resource usage over the performance gains of fully unrolling this loop.
For NVPTX however, the builtin implementation causes the resource usage
to go down (36 registers total for a regular `fputs` call) so we will
maintain that implementation.

I think specializing this is the right call as we will always prefer the
implementation with the smallest resource footprint for this interface,
as performance is already going to be heavily bottlenecked by the use of
fine-grained memory.




More information about the All-commits mailing list