[llvm] [SPIR-V] Implement correct zeroinitializer for extension types in SPIR-V Backend (PR #93607)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 20:54:42 PDT 2024


================
@@ -1191,8 +1191,7 @@ void SPIRVEmitIntrinsics::processInstrAfterVisit(Instruction *I,
       B.SetInsertPoint(I);
       Value *OpTyVal = Op;
       if (Op->getType()->isTargetExtTy())
-        OpTyVal = Constant::getNullValue(
-            IntegerType::get(I->getContext(), GR->getPointerSize()));
+        OpTyVal = UndefValue::get(Op->getType());
----------------
efriedma-quic wrote:

Prefer PoisonValue::get() unless you need "undef" for some specific reason.

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


More information about the llvm-commits mailing list