================
@@ -843,10 +844,40 @@ Register SPIRVGlobalRegistry::buildGlobalVariable(
   if (&GVBuilder.getMBB() != &EntryBB)
     GVBuilder.setInsertPt(EntryBB, EntryBB.getFirstTerminator());
 
-  auto MIB = GVBuilder.buildInstr(SPIRV::OpVariable)
+  // Pointers to opaque types stay typed even with the extension on, so emit 
the
+  // untyped variant only when the result is actually an untyped pointer.
+  const SPIRVSubtarget &Subtarget =
+      cast<SPIRVSubtarget>(MIRBuilder.getMF().getSubtarget());
+  const bool UseUntypedPointers =
+      BaseType->getOpcode() == SPIRV::OpTypeUntypedPointerKHR;
----------------
MrSidims wrote:

renamed, thanks!

https://github.com/llvm/llvm-project/pull/201233
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to