================
@@ -1464,6 +1497,23 @@ unsigned 
SPIRVGlobalRegistry::getNumScalarOrVectorTotalBitWidth(
              : 0;
 }
 
+bool SPIRVGlobalRegistry::isSpecialOpaqueElementType(
+    SPIRVTypeInst ElemType) const {
+  // A function pointer has to keep its function type, which an untyped pointer
+  // cannot express.
+  if (ElemType && ElemType->getOpcode() == SPIRV::OpTypeFunction)
+    return true;
+  auto It = SPIRVToLLVMType.find(ElemType);
+  return It != SPIRVToLLVMType.end() && It->second &&
+         isSpecialOpaqueType(It->second);
+}
+
+bool SPIRVGlobalRegistry::shouldUseUntypedPointer(
+    SPIRVTypeInst ElemType, const SPIRVSubtarget &ST) const {
+  return ST.canUseExtension(SPIRV::Extension::SPV_KHR_untyped_pointers) &&
+         !ST.isShader() && !isSpecialOpaqueElementType(ElemType);
----------------
maarquitos14 wrote:

Shader is not supported here because of an implementation decision we made, but 
it is supported by the spec, isn't it? If so, might deserve a comment 
explaining it?

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