[llvm] [SPIRV] Fix code quality issues. (PR #152005)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 08:25:22 PDT 2025


================
@@ -893,9 +893,11 @@ Type *SPIRVEmitIntrinsics::deduceNestedTypeHelper(
     bool Change = false;
     for (unsigned i = 0; i < U->getNumOperands(); ++i) {
       Value *Op = U->getOperand(i);
-      Type *OpTy = Op->getType();
-      Type *Ty = OpTy;
+      Type *OpTy = nullptr;
+      Type *Ty = nullptr;
       if (Op) {
+        OpTy = Op->getType();
+        Ty = OpTy;
----------------
Keenuts wrote:

Yes, I think this is the correct fix (the current condition seems to say Op is allowed to be nullptr somehow, but seems like this is wrong)

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


More information about the llvm-commits mailing list