[llvm] [SPIR-V] Add lowering of ptrtoaddr (PR #184577)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 07:59:17 PST 2026


================
@@ -1725,6 +1727,57 @@ Instruction *SPIRVEmitIntrinsics::visitBitCastInst(BitCastInst &I) {
   return NewI;
 }
 
+Instruction *SPIRVEmitIntrinsics::visitPtrToAddrInst(PtrToAddrInst &I) {
----------------
s-perron wrote:

We don't expect to see ptrtoaddr at all in our flow. If someone adds it for some FE other than HLSL, there is no SPIR-V equivalent at this time, so I would expect this code to be the correct one.

Note that you can convert integers to pointers and vice versa, but not in logical addressing. Vulkan does allow PhysicalStorageBuffer64. We will be generating that at some point.

https://github.com/llvm/llvm-project/pull/184577


More information about the llvm-commits mailing list