[all-commits] [llvm/llvm-project] ffc558: [SPIRV] Add support for pointers to functions with...

Alex Voicu via All-commits all-commits at lists.llvm.org
Sun Dec 7 12:17:46 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ffc55815ef3208a3802513c33ac66a122d2fb680
      https://github.com/llvm/llvm-project/commit/ffc55815ef3208a3802513c33ac66a122d2fb680
  Author: Alex Voicu <alexandru.voicu at amd.com>
  Date:   2025-12-07 (Sun, 07 Dec 2025)

  Changed paths:
    M llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
    M llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
    M llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
    M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
    M llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp
    M llvm/lib/Target/SPIRV/SPIRVUtils.cpp
    M llvm/lib/Target/SPIRV/SPIRVUtils.h
    A llvm/test/CodeGen/SPIRV/pointers/fun-with-aggregate-arg-in-const-init.ll

  Log Message:
  -----------
  [SPIRV] Add support for pointers to functions with aggregate args/returns as global variables / constant initialisers (#169595)

This patch does two things:

1. it extends the aggregate arg / ret replacement transform to work on
indirect calls / pointers to function. It is somewhat spread out as
retrieving the original function type is needed in a few places. In
general, we should rethink / rework the entire infrastructure around
aggregate arg/ret handling, using an opaque target specific type rather
than i32;
2. it enables global variables of pointer to function type, and, more
specifically, global variables of a aggregate type (arrays / structures)
with pointer to function elements.

This also exposes some issues in how we handle pointers to function and
lowering indirect function calls, primarily around not using the program
address space. These will be handled in a subsequent patch as they'll
require somewhat more intrusive surgery, possibly involving modifying
the data layout.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list