llvm / llvm/llvm-project

[SPIRV] Use of `OpConvertUToPtr`/`OpConvertPtrToU` does not insert `OpCapability Addresses`/`OpCapability PhysicalStorageBufferAddresses`

Open
#202,302 1 comment 0 reactions 0 assignees View on GitHub
backend:SPIR-V
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Usage of LLVM instructions `inttoptr` / `ptrtoint` correctly generate `OpConvertUToPtr`/`OpConvertPtrToU` instructions but does not subsequently add `OpCapability Addresses`/`OpCapability PhysicalStorageBufferAddresses` to the list of required capabilities of the generated SPIRV module.

It would seem https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp#L1520 that switch is missing the a `case` for `OpConvertUToPtr`/`OpConvertPtrToU` to insert the appropriate `OpCapability`.

[vulkan_out_vulkan130_64.ll.txt](https://github.com/user-attachments/files/28702018/vulkan_out_vulkan130_64.ll.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.