================
@@ -2848,8 +2906,11 @@ bool 
SPIRVInstructionSelector::selectAddrSpaceCast(Register ResVReg,
   SPIRVTypeInst SrcPtrTy = GR.getSPIRVTypeForVReg(SrcPtr);
 
   // don't generate a cast for a null that may be represented by OpTypeInt
-  if (SrcPtrTy->getOpcode() != SPIRV::OpTypePointer ||
-      ResType->getOpcode() != SPIRV::OpTypePointer)
+  auto IsPtrTy = [](SPIRVTypeInst T) {
+    return T && (T->getOpcode() == SPIRV::OpTypePointer ||
----------------
sarnex wrote:

sure, 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