[llvm] [SPIR-V] Fix warning -Wsometimes-uninitialized (PR #83901)

Michal Paszkowski via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 12:02:19 PST 2024


https://github.com/michalpaszkowski created https://github.com/llvm/llvm-project/pull/83901

None

>From 96fb17d80143fe4a7a6221b8acf53863211a1cfc Mon Sep 17 00:00:00 2001
From: Michal Paszkowski <michal at paszkowski.org>
Date: Mon, 4 Mar 2024 11:59:22 -0800
Subject: [PATCH] [SPIR-V] Fix warning -Wsometimes-uninitialized

---
 llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
index 6a700014ea93ce..c83537bc7ae8a5 100644
--- a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
@@ -620,7 +620,7 @@ void SPIRVEmitIntrinsics::insertAssignPtrTypeIntrs(Instruction *I) {
     EltTyConst = UndefValue::get(AI->getAllocatedType());
   else if (auto *GEP = dyn_cast<GetElementPtrInst>(I))
     EltTyConst = UndefValue::get(GEP->getResultElementType());
-  else if (I->getType()->isPointerTy())
+  else
     EltTyConst = UndefValue::get(IntegerType::getInt8Ty(I->getContext()));
 
   buildIntrWithMD(Intrinsic::spv_assign_ptr_type, {I->getType()}, EltTyConst, I,



More information about the llvm-commits mailing list