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

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 12:15:42 PST 2024


Author: Michal Paszkowski
Date: 2024-03-04T12:15:38-08:00
New Revision: 72cf95df2f69a1c023ef404298f3cce2e6b44d86

URL: https://github.com/llvm/llvm-project/commit/72cf95df2f69a1c023ef404298f3cce2e6b44d86
DIFF: https://github.com/llvm/llvm-project/commit/72cf95df2f69a1c023ef404298f3cce2e6b44d86.diff

LOG: [SPIR-V] Fix warning -Wsometimes-uninitialized (#83901)

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Removed: 
    


################################################################################
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