This is an archive of the discontinued LLVM Phabricator instance.

[SPIR-V] Map IR function pointers to registers in ModuleAnalysis
ClosedPublic

Authored by mpaszkowski on Dec 22 2022, 6:05 AM.

Details

Summary

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.

New LIT test multiple-anonymous-functions.ll replaces the old internal-anonymous-function.ll. Additionally, OpenCL CTS spirv_new/function_pure_ptr test should pass now.

Diff Detail

Event Timeline

mpaszkowski created this revision.Dec 22 2022, 6:05 AM
mpaszkowski requested review of this revision.Dec 22 2022, 6:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 6:05 AM
arsenm added inline comments.Dec 22 2022, 6:07 AM
llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h
134–135

Typo coresponding

llvm/test/CodeGen/SPIRV/function/multiple-anonymous-functions.ll
35

Don't use anonymous values in tests

mpaszkowski marked 2 inline comments as done.

@arsenm Thanks! I uploaded a new updated patch.

iliya-diyachkov accepted this revision.Jan 7 2023, 2:35 AM

Thanks Michal, the patch looks good to me.

This revision is now accepted and ready to land.Jan 7 2023, 2:35 AM
This revision was landed with ongoing or failed builds.Jan 7 2023, 6:40 AM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/SPIRV/SPIRVUtils.cpp