[llvm] [SPIR-V] Emit DebugTypePointer from NonSemantic DI (PR #109287)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 04:42:48 PDT 2024


================
@@ -247,11 +263,31 @@ bool SPIRVEmitNonSemanticDI::emitGlobalDI(MachineFunction &MF) {
       const Register AttributeEncodingReg =
           GR->buildConstantInt(AttributeEncoding, MIRBuilder, I32Ty, false);
 
-      [[maybe_unused]]
       const Register BasicTypeReg =
           EmitDIInstruction(SPIRV::NonSemanticExtInst::DebugTypeBasic,
                             {BasicTypeStrReg, ConstIntBitwidthReg,
                              AttributeEncodingReg, I32ZeroReg});
+      BasicTypeRegPairs.emplace_back(BasicType, BasicTypeReg);
+    }
+
+    if (PointerDerivedTypes.size()) {
+      const Register GenericStorageClass =
+          GR->buildConstantInt(8, MIRBuilder, I32Ty, false);
----------------
MrSidims wrote:

Generic storage class is enabled with a Addresses capability aka non-default. I'm fine with such behavior, but would be nice to hear from people work on Shader SPIR-V what would the prefer as the default, @VyacheslavLevytskyy may I ask you to tag them here?

also a nit: 8 -> StorageClass::Generic (or other appropriate enum value defined for SPIR-V backend)

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


More information about the llvm-commits mailing list