[SPIR-V] Map IR function pointers to registers in ModuleAnalysis
authorMichal Paszkowski <michal.paszkowski@outlook.com>
Sat, 7 Jan 2023 14:25:53 +0000 (15:25 +0100)
committerMichal Paszkowski <michal.paszkowski@outlook.com>
Sat, 7 Jan 2023 14:38:01 +0000 (15:38 +0100)
commit99203241df4d73e569e9219105fec76919f07c19
tree74532ab3de4a21ec28c1d22226de091e33a35777
parent0d4ab5de7f13415f2b02dfee1f815c2663de8022
[SPIR-V] Map IR function pointers to registers in ModuleAnalysis

SPIRVModuleAnalysis collects module and external function registers
(usually result of OpFunction) for use when emitting OpFunctionCall.
This patch makes the mapping between the functions and registers using
pointers (instead of name strings) to ensure anonymous functions and
calls can be resolved properly.

Differential Revision: https://reviews.llvm.org/D140548
llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h
llvm/lib/Target/SPIRV/SPIRVUtils.cpp
llvm/lib/Target/SPIRV/SPIRVUtils.h
llvm/test/CodeGen/SPIRV/function/internal-anonymous-function.ll [deleted file]
llvm/test/CodeGen/SPIRV/function/multiple-anonymous-functions.ll [new file with mode: 0644]