Skip to content

Commit 33696aa

Browse files
vmaksimojsji
authored andcommitted
Use poison instead of undef values wherever possible (#2960)
In reverse translation always use poison values except cases where we translate OpUndef. In other cases common sense was used to define where it is safe to replace undef to poison (e.g. in creating structures, regularization passes). This resolves #2953 and aligns us with the LLVM community in terms of generating IR. Original commit: KhronosGroup/SPIRV-LLVM-Translator@cec12d6cf46306d
1 parent 41f6405 commit 33696aa

38 files changed

+132
-128
lines changed

llvm-spirv/docs/SPIRVRepresentationInLLVM.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ scalar component is mapped to a function call with index argument, i.e.:
261261
262262
; However SPIRV-LLVM translator will transform it to the following pattern:
263263
%1 = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 0)
264-
%2 = insertelement <3 x i64> undef, i64 %1, i32 0
264+
%2 = insertelement <3 x i64> poison, i64 %1, i32 0
265265
%3 = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 1)
266266
%4 = insertelement <3 x i64> %2, i64 %3, i32 1
267267
%5 = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 2)

llvm-spirv/lib/SPIRV/LLVMSaddWithOverflow.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if.then: ; preds = %entry
162162
if.end21: ; preds = %if.then, %entry
163163
%overflow = phi i1 [ 0, %entry ], [ %or.cond40, %if.then ]
164164
%add24 = add i16 %b, %a
165-
%agg = insertvalue {i16, i1} undef, i16 %add24, 0
165+
%agg = insertvalue {i16, i1} poison, i16 %add24, 0
166166
%res = insertvalue {i16, i1} %agg, i1 %overflow, 1
167167
ret {i16, i1} %res
168168
}
@@ -202,7 +202,7 @@ if.then12: ; preds = %land.lhs.true, %if.
202202
if.end23: ; preds = %if.then12, %if.else, %land.lhs.true
203203
%overflow = phi i1 [ 1, %land.lhs.true ], [ 0, %if.else ], [ %or.cond43, %if.then12 ]
204204
%add24 = add nsw i32 %b, %a
205-
%agg = insertvalue {i32, i1} undef, i32 %add24, 0
205+
%agg = insertvalue {i32, i1} poison, i32 %add24, 0
206206
%res = insertvalue {i32, i1} %agg, i1 %overflow, 1
207207
ret {i32, i1} %res
208208
}
@@ -242,7 +242,7 @@ if.then12: ; preds = %land.lhs.true, %if.
242242
if.end23: ; preds = %if.then12, %if.else, %land.lhs.true
243243
%overflow = phi i1 [ 1, %land.lhs.true ], [ 0, %if.else ], [ %or.cond42, %if.then12 ]
244244
%add24 = add nsw i64 %b, %a
245-
%agg = insertvalue {i64, i1} undef, i64 %add24, 0
245+
%agg = insertvalue {i64, i1} poison, i64 %add24, 0
246246
%res = insertvalue {i64, i1} %agg, i1 %overflow, 1
247247
ret {i64, i1} %res
248248
}

llvm-spirv/lib/SPIRV/LLVMToSPIRVDbgTran.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void LLVMToSPIRVDbgTran::finalizeDebugValue(
161161
DIExpression *Expr = DbgValue->getExpression();
162162
if (!isNonSemanticDebugInfo()) {
163163
if (DbgValue->getNumVariableLocationOps() > 1) {
164-
Val = UndefValue::get(Val->getType());
164+
Val = PoisonValue::get(Val->getType());
165165
Expr = DIExpression::get(M->getContext(), {});
166166
}
167167
}

llvm-spirv/lib/SPIRV/OCLToSPIRV.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ void OCLToSPIRVBase::visitCallGetImageSize(CallInst *CI,
10651065
} else if (Desc.Dim == Dim2D && Desc.Arrayed) {
10661066
Constant *Index[] = {getInt32(M, 0), getInt32(M, 1)};
10671067
Constant *Mask = ConstantVector::get(Index);
1068-
return new ShuffleVectorInst(NCI, UndefValue::get(NCI->getType()),
1068+
return new ShuffleVectorInst(NCI, PoisonValue::get(NCI->getType()),
10691069
Mask, NCI->getName(),
10701070
CI->getIterator());
10711071
}
@@ -1410,9 +1410,9 @@ void OCLToSPIRVBase::visitCallScalToVec(CallInst *CI, StringRef MangledName,
14101410
for (auto I : ScalarPos)
14111411
Mutator.mapArg(I, [&](Value *V) {
14121412
Instruction *Inst = InsertElementInst::Create(
1413-
UndefValue::get(VecTy), V, getInt32(M, 0), "", CI->getIterator());
1413+
PoisonValue::get(VecTy), V, getInt32(M, 0), "", CI->getIterator());
14141414
return new ShuffleVectorInst(
1415-
Inst, UndefValue::get(VecTy),
1415+
Inst, PoisonValue::get(VecTy),
14161416
ConstantVector::getSplat(VecElemCount, getInt32(M, 0)), "",
14171417
CI->getIterator());
14181418
});

llvm-spirv/lib/SPIRV/SPIRVLowerBitCastToNonStandardType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static Value *removeBitCasts(Value *OldValue, Type *NewTy, NFIRBuilder &Builder,
6565
// If there's only one use, don't create a bitcast for any uses, since it
6666
// will be immediately replaced anyways.
6767
if (OldValue->hasOneUse()) {
68-
OldValue->replaceAllUsesWith(UndefValue::get(OldValue->getType()));
68+
OldValue->replaceAllUsesWith(PoisonValue::get(OldValue->getType()));
6969
} else {
7070
OldValue->replaceAllUsesWith(
7171
Builder.CreateBitCast(NewValue, OldValue->getType()));
@@ -95,7 +95,7 @@ static Value *removeBitCasts(Value *OldValue, Type *NewTy, NFIRBuilder &Builder,
9595
if (auto *BC = dyn_cast<BitCastInst>(OldValue)) {
9696
if (BC->getSrcTy() == NewTy) {
9797
if (BC->hasOneUse()) {
98-
BC->replaceAllUsesWith(UndefValue::get(BC->getType()));
98+
BC->replaceAllUsesWith(PoisonValue::get(BC->getType()));
9999
InstsToErase.push_back(BC);
100100
}
101101
return BC->getOperand(0);

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
16711671
Constant *Initializer = nullptr;
16721672
if (IsVectorCompute) {
16731673
AddrSpace = VectorComputeUtil::getVCGlobalVarAddressSpace(BS);
1674-
Initializer = UndefValue::get(Ty);
1674+
Initializer = PoisonValue::get(Ty);
16751675
} else
16761676
AddrSpace = SPIRSPIRVAddrSpaceMap::rmap(BS);
16771677
// Force SPIRV BuiltIn variable's name to be __spirv_BuiltInXXXX.
@@ -1690,7 +1690,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
16901690
Initializer = Constant::getNullValue(Ty);
16911691
else if (BS == SPIRVStorageClassKind::StorageClassWorkgroup &&
16921692
LinkageTy != GlobalValue::ExternalLinkage)
1693-
Initializer = dyn_cast<Constant>(UndefValue::get(Ty));
1693+
Initializer = dyn_cast<Constant>(PoisonValue::get(Ty));
16941694
else if ((LinkageTy != GlobalValue::ExternalLinkage) &&
16951695
(BS == SPIRVStorageClassKind::StorageClassCrossWorkgroup))
16961696
Initializer = Constant::getNullValue(Ty);
@@ -2023,7 +2023,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
20232023
for (unsigned Idx = 0; Idx != N; ++Idx) {
20242024
Value *S = Builder.CreateExtractElement(Vec, Builder.getInt32(Idx));
20252025
Value *Lhs = Builder.CreateVectorSplat(M, S);
2026-
Value *Rhs = UndefValue::get(VTy);
2026+
Value *Rhs = PoisonValue::get(VTy);
20272027
for (unsigned Idx2 = 0; Idx2 != M; ++Idx2) {
20282028
Value *Vx = Builder.CreateExtractValue(Mat, Idx2);
20292029
Value *Vxi = Builder.CreateExtractElement(Vx, Builder.getInt32(Idx));
@@ -2048,7 +2048,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
20482048
Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
20492049
NewVec->takeName(Scalar);
20502050

2051-
Value *V = UndefValue::get(Matrix->getType());
2051+
Value *V = PoisonValue::get(Matrix->getType());
20522052
for (uint64_t Idx = 0; Idx != ColNum; Idx++) {
20532053
auto *Col = Builder.CreateExtractValue(Matrix, Idx);
20542054
auto *I = Builder.CreateFMul(Col, NewVec);
@@ -2150,7 +2150,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
21502150
auto *VTy = FixedVectorType::get(ETy, R1);
21512151
auto *ResultTy = ArrayType::get(VTy, C2);
21522152

2153-
Value *Res = UndefValue::get(ResultTy);
2153+
Value *Res = PoisonValue::get(ResultTy);
21542154

21552155
for (unsigned Idx = 0; Idx != C2; ++Idx) {
21562156
Value *U = Builder.CreateExtractValue(M2, Idx);
@@ -2183,7 +2183,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
21832183

21842184
auto *VTy = FixedVectorType::get(ColTy->getElementType(), ColNum);
21852185
auto *ResultTy = ArrayType::get(VTy, RowNum);
2186-
Value *V = UndefValue::get(ResultTy);
2186+
Value *V = PoisonValue::get(ResultTy);
21872187

21882188
SmallVector<Value *, 16> MCache;
21892189
MCache.reserve(ColNum);
@@ -2223,7 +2223,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
22232223

22242224
// Slowpath
22252225
for (unsigned Idx = 0; Idx != RowNum; ++Idx) {
2226-
Value *Vec = UndefValue::get(VTy);
2226+
Value *Vec = PoisonValue::get(VTy);
22272227

22282228
for (unsigned Idx2 = 0; Idx2 != ColNum; ++Idx2) {
22292229
Value *S =
@@ -2504,7 +2504,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
25042504
IntegerType *Int32Ty = IntegerType::get(*Context, 32);
25052505
for (auto I : VS->getComponents()) {
25062506
if (I == static_cast<SPIRVWord>(-1))
2507-
Components.push_back(UndefValue::get(Int32Ty));
2507+
Components.push_back(PoisonValue::get(Int32Ty));
25082508
else
25092509
Components.push_back(ConstantInt::get(Int32Ty, I));
25102510
}
@@ -2779,7 +2779,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
27792779
CarryInt = Builder.CreateZExt(Carry, Result->getType());
27802780
}
27812781
auto *ResultStruct =
2782-
Builder.CreateInsertValue(UndefValue::get(StructType::get(
2782+
Builder.CreateInsertValue(PoisonValue::get(StructType::get(
27832783
Result->getType(), CarryInt->getType())),
27842784
Result, 0);
27852785
ResultStruct = Builder.CreateInsertValue(ResultStruct, CarryInt, 1);
@@ -2811,8 +2811,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
28112811
PointerType *Int8PtrTyPrivate = PointerType::get(*Context, SPIRAS_Private);
28122812
IntegerType *Int32Ty = Type::getInt32Ty(*Context);
28132813

2814-
Value *UndefInt8Ptr = UndefValue::get(Int8PtrTyPrivate);
2815-
Value *UndefInt32 = UndefValue::get(Int32Ty);
2814+
Value *UndefInt8Ptr = PoisonValue::get(Int8PtrTyPrivate);
2815+
Value *UndefInt32 = PoisonValue::get(Int32Ty);
28162816

28172817
Constant *GS = Builder.CreateGlobalString(kOCLBuiltinName::FPGARegIntel);
28182818

@@ -4070,8 +4070,8 @@ void SPIRVToLLVM::transIntelFPGADecorations(SPIRVValue *BV, Value *V) {
40704070
Type *Int8PtrTyPrivate = PointerType::get(*Context, SPIRAS_Private);
40714071
IntegerType *Int32Ty = IntegerType::get(*Context, 32);
40724072

4073-
Value *UndefInt8Ptr = UndefValue::get(Int8PtrTyPrivate);
4074-
Value *UndefInt32 = UndefValue::get(Int32Ty);
4073+
Value *UndefInt8Ptr = PoisonValue::get(Int8PtrTyPrivate);
4074+
Value *UndefInt32 = PoisonValue::get(Int32Ty);
40754075

40764076
if (AL && BV->getType()->getPointerElementType()->isTypeStruct()) {
40774077
auto *ST = BV->getType()->getPointerElementType();
@@ -4208,8 +4208,8 @@ void SPIRVToLLVM::transIntelFPGADecorations(SPIRVValue *BV, Value *V) {
42084208

42094209
llvm::Constant *Fields[5] = {
42104210
C, ConstantExpr::getBitCast(GS, Int8PtrTyPrivate),
4211-
UndefValue::get(Int8PtrTyPrivate), UndefValue::get(Int32Ty),
4212-
UndefValue::get(Int8PtrTyPrivate)};
4211+
PoisonValue::get(Int8PtrTyPrivate), PoisonValue::get(Int32Ty),
4212+
PoisonValue::get(Int8PtrTyPrivate)};
42134213

42144214
GlobalAnnotations.push_back(ConstantStruct::getAnon(Fields));
42154215
}
@@ -4269,8 +4269,8 @@ void SPIRVToLLVM::transUserSemantic(SPIRV::SPIRVFunction *Fun) {
42694269

42704270
llvm::Constant *Fields[5] = {
42714271
C, ConstantExpr::getBitCast(GS, Int8PtrTyPrivate),
4272-
UndefValue::get(Int8PtrTyPrivate), UndefValue::get(Int32Ty),
4273-
UndefValue::get(Int8PtrTyPrivate)};
4272+
PoisonValue::get(Int8PtrTyPrivate), PoisonValue::get(Int32Ty),
4273+
PoisonValue::get(Int8PtrTyPrivate)};
42744274
GlobalAnnotations.push_back(ConstantStruct::getAnon(Fields));
42754275
}
42764276
}
@@ -4627,7 +4627,7 @@ bool SPIRVToLLVM::transMetadata() {
46274627
std::vector<Metadata *> MetadataVec;
46284628
Type *VecHintTy = decodeVecTypeHint(*Context, EM->getLiterals()[0]);
46294629
assert(VecHintTy);
4630-
MetadataVec.push_back(ValueAsMetadata::get(UndefValue::get(VecHintTy)));
4630+
MetadataVec.push_back(ValueAsMetadata::get(PoisonValue::get(VecHintTy)));
46314631
MetadataVec.push_back(ConstantAsMetadata::get(
46324632
ConstantInt::get(Type::getInt32Ty(*Context), 1)));
46334633
F->setMetadata(kSPIR2MD::VecTyHint, MDNode::get(*Context, MetadataVec));

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void SPIRVRegularizeLLVMBase::buildUMulWithOverflowFunc(Function *UMulFunc) {
231231
// umul.with.overflow intrinsic return a structure, where the first element
232232
// is the multiplication result, and the second is an overflow bit.
233233
auto *StructTy = UMulFunc->getReturnType();
234-
auto *Agg = Builder.CreateInsertValue(UndefValue::get(StructTy), Mul, {0});
234+
auto *Agg = Builder.CreateInsertValue(PoisonValue::get(StructTy), Mul, {0});
235235
auto *Res = Builder.CreateInsertValue(Agg, Overflow, {1});
236236
Builder.CreateRet(Res);
237237
}
@@ -487,7 +487,7 @@ void regularizeWithOverflowInstrinsics(StringRef MangledName, CallInst *Call,
487487
Value *V2 = Builder.CreateICmpNE(V1, ConstZero);
488488
Type *StructI32I1Ty =
489489
StructType::create(Call->getContext(), {RetTy, V2->getType()});
490-
Value *Undef = UndefValue::get(StructI32I1Ty);
490+
Value *Undef = PoisonValue::get(StructI32I1Ty);
491491
Value *V3 = Builder.CreateInsertValue(Undef, V0, {0});
492492
Value *V4 = Builder.CreateInsertValue(V3, V2, {1});
493493
SmallVector<User *> Users(Call->users());
@@ -753,7 +753,7 @@ bool SPIRVRegularizeLLVMBase::regularize() {
753753
IRBuilder<> Builder(Cmpxchg);
754754
auto *Cmp = Builder.CreateICmpEQ(Res, Comparator, "cmpxchg.success");
755755
auto *V1 = Builder.CreateInsertValue(
756-
UndefValue::get(Cmpxchg->getType()), Res, 0);
756+
PoisonValue::get(Cmpxchg->getType()), Res, 0);
757757
auto *V2 = Builder.CreateInsertValue(V1, Cmp, 1, Cmpxchg->getName());
758758
Cmpxchg->replaceAllUsesWith(V2);
759759
ToErase.push_back(Cmpxchg);

llvm-spirv/lib/SPIRV/SPIRVToOCL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ void SPIRVToOCLBase::visitCallSPIRVImageQuerySize(CallInst *CI) {
326326
assert(ImgQuerySizeRetEls == 2 &&
327327
"OpImageQuerySize[Lod] must return <2 x iN> vector type");
328328
GetImageSize = InsertElementInst::Create(
329-
UndefValue::get(VecTy), GetImageSize, ConstantInt::get(Int32Ty, 0),
329+
PoisonValue::get(VecTy), GetImageSize, ConstantInt::get(Int32Ty, 0),
330330
CI->getName(), CI->getIterator());
331331
} else {
332332
// get_image_dim and OpImageQuerySize returns different vector
@@ -337,7 +337,7 @@ void SPIRVToOCLBase::visitCallSPIRVImageQuerySize(CallInst *CI) {
337337
Constant *Mask = ConstantVector::get(MaskEls);
338338

339339
GetImageSize = new ShuffleVectorInst(
340-
GetImageSize, UndefValue::get(GetImageSize->getType()), Mask,
340+
GetImageSize, PoisonValue::get(GetImageSize->getType()), Mask,
341341
CI->getName(), CI->getIterator());
342342
}
343343
}
@@ -779,7 +779,7 @@ void SPIRVToOCLBase::visitCallSPIRVImageSampleExplicitLodBuiltIn(CallInst *CI,
779779

780780
if (CallSampledImg->hasOneUse()) {
781781
CallSampledImg->replaceAllUsesWith(
782-
UndefValue::get(CallSampledImg->getType()));
782+
PoisonValue::get(CallSampledImg->getType()));
783783
CallSampledImg->dropAllReferences();
784784
CallSampledImg->eraseFromParent();
785785
}
@@ -871,7 +871,7 @@ void SPIRVToOCLBase::visitCallSPIRVAvcINTELEvaluateBuiltIn(CallInst *CI,
871871

872872
auto EraseVmeImageCall = [](CallInst *CI) {
873873
if (CI->hasOneUse()) {
874-
CI->replaceAllUsesWith(UndefValue::get(CI->getType()));
874+
CI->replaceAllUsesWith(PoisonValue::get(CI->getType()));
875875
CI->dropAllReferences();
876876
CI->eraseFromParent();
877877
}

llvm-spirv/lib/SPIRV/SPIRVUtil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ bool isSPIRVBuiltinVariable(GlobalVariable *GV,
19631963
// %d = extractelement <3 x i64> %b, i32 idx
19641964
// With:
19651965
// %0 = call spir_func i64 @_Z13get_global_idj(i32 0) #1
1966-
// %1 = insertelement <3 x i64> undef, i64 %0, i32 0
1966+
// %1 = insertelement <3 x i64> poison, i64 %0, i32 0
19671967
// %2 = call spir_func i64 @_Z13get_global_idj(i32 1) #1
19681968
// %3 = insertelement <3 x i64> %1, i64 %2, i32 1
19691969
// %4 = call spir_func i64 @_Z13get_global_idj(i32 2) #1
@@ -1978,7 +1978,7 @@ bool isSPIRVBuiltinVariable(GlobalVariable *GV,
19781978
// %2 = load i64, i64 addrspace(4)* %1, align 32
19791979
// With:
19801980
// %0 = call spir_func i64 @_Z13get_global_idj(i32 0) #1
1981-
// %1 = insertelement <3 x i64> undef, i64 %0, i32 0
1981+
// %1 = insertelement <3 x i64> poison, i64 %0, i32 0
19821982
// %2 = call spir_func i64 @_Z13get_global_idj(i32 1) #1
19831983
// %3 = insertelement <3 x i64> %1, i64 %2, i32 1
19841984
// %4 = call spir_func i64 @_Z13get_global_idj(i32 2) #1
@@ -2034,7 +2034,7 @@ static void replaceUsesOfBuiltinVar(Value *V, const APInt &AccumulatedOffset,
20342034
if (!Index.isZero() || DL.getTypeSizeInBits(VecTy) !=
20352035
DL.getTypeSizeInBits(Load->getType()))
20362036
llvm_unreachable("Illegal use of a SPIR-V builtin variable");
2037-
Replacement = UndefValue::get(VecTy);
2037+
Replacement = PoisonValue::get(VecTy);
20382038
for (unsigned I = 0; I < VecTy->getNumElements(); I++) {
20392039
Replacement = Builder.CreateInsertElement(
20402040
Replacement,

llvm-spirv/test/DebugInfo/LocalAddressSpace.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
; CHECK-SPIRV: Variable {{[0-9]+}} [[foo_a:[0-9]+]]
1616
; CHECK-SPIRV: DebugGlobalVariable {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} [[foo_a]]
1717

18-
; CHECK-LLVM: @foo.a = internal addrspace(3) global i32 undef, align 4, !dbg ![[a_dbg_expr:[0-9]+]]
18+
; CHECK-LLVM: @foo.a = internal addrspace(3) global i32 poison, align 4, !dbg ![[a_dbg_expr:[0-9]+]]
1919
; CHECK-LLVM: ![[a_dbg_expr]] = !DIGlobalVariableExpression(var: ![[a_dbg_var:[0-9]+]],
2020
; CHECK-LLVM: ![[a_dbg_var]] = distinct !DIGlobalVariable(name: "a"
2121

llvm-spirv/test/DebugInfo/builtin-get-global-id.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ entry:
2828
%gid = alloca i64, align 8
2929
%call = call spir_func i64 @_Z13get_global_idj(i32 0) #2, !dbg !10
3030
; CHECK: [[I0:%[0-9]]] = call spir_func i64 @_Z13get_global_idj(i32 0) #1, !dbg [[DBG:![0-9]+]]
31-
; CHECK-NEXT: [[I1:%[0-9]]] = insertelement <3 x i64> undef, i64 [[I0]], i32 0, !dbg [[DBG]]
31+
; CHECK-NEXT: [[I1:%[0-9]]] = insertelement <3 x i64> poison, i64 [[I0]], i32 0, !dbg [[DBG]]
3232
; CHECK-NEXT: [[I2:%[0-9]]] = call spir_func i64 @_Z13get_global_idj(i32 1) #1, !dbg [[DBG]]
3333
; CHECK-NEXT: [[I3:%[0-9]]] = insertelement <3 x i64> [[I1]], i64 [[I2]], i32 1, !dbg [[DBG]]
3434
; CHECK-NEXT: [[I4:%[0-9]]] = call spir_func i64 @_Z13get_global_idj(i32 2) #1, !dbg [[DBG]]

llvm-spirv/test/OpDecorateString_UserSemantic.spvasm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
; the SPIR-V LLVM Translator and not rejected by spirv-val.
1919
OpDecorateString %temp UserSemantic "foo"
2020
; CHECK: [[STR:@[0-9_.]+]] = {{.*}}foo
21-
; CHECK: call void @llvm.var.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr undef, i32 undef, ptr undef)
21+
; CHECK: call void @llvm.var.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr poison, i32 poison, ptr poison)
2222
%uint = OpTypeInt 32 0
2323
%void = OpTypeVoid
2424
%kernel_sig = OpTypeFunction %void %uint

llvm-spirv/test/OpMemberDecorateString_UserSemantic.spvasm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
; CHECK: [[STR:@[0-9_.]+]] = {{.*}}foo
1919
; Note: this is checking for an annotation on an instantiation of the structure,
2020
; which is different than an annotation on the structure type.
21-
; CHECK: call ptr @llvm.ptr.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr undef, i32 undef, ptr undef)
21+
; CHECK: call ptr @llvm.ptr.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr poison, i32 poison, ptr poison)
2222
%uint = OpTypeInt 32 0
2323
%uint_0 = OpConstant %uint 0
2424
%void = OpTypeVoid

0 commit comments

Comments
 (0)