================
@@ -621,13 +621,17 @@ bool SPIRVTargetLowering::enforcePtrTypeCompatibility(
     MachineInstr &I, unsigned int PtrOpIdx, unsigned int OpIdx) const {
   SPIRVGlobalRegistry &GR = *STI.getSPIRVGlobalRegistry();
   SPIRVTypeInst PtrType = GR.getResultType(I.getOperand(PtrOpIdx).getReg());
+
+  if (PtrType && PtrType->getOpcode() == SPIRV::OpTypeUntypedPointerKHR)
+    return true;
+
   SPIRVTypeInst PointeeType = GR.getPointeeType(PtrType);
   SPIRVTypeInst OpType = GR.getResultType(I.getOperand(OpIdx).getReg());
 
   if (PointeeType == OpType)
     return true;
 
-  if (typesLogicallyMatch(PointeeType, OpType, GR)) {
+  if (PointeeType && OpType && typesLogicallyMatch(PointeeType, OpType, GR)) {
----------------
MrSidims wrote:

added comment

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