Skip to content

Commit cec12d6

Browse files
authored
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.
1 parent f5e27fe commit cec12d6

38 files changed

+132
-128
lines changed

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)

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
}

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
}

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
});

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);

lib/SPIRV/SPIRVReader.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
16691669
Constant *Initializer = nullptr;
16701670
if (IsVectorCompute) {
16711671
AddrSpace = VectorComputeUtil::getVCGlobalVarAddressSpace(BS);
1672-
Initializer = UndefValue::get(Ty);
1672+
Initializer = PoisonValue::get(Ty);
16731673
} else
16741674
AddrSpace = SPIRSPIRVAddrSpaceMap::rmap(BS);
16751675
// Force SPIRV BuiltIn variable's name to be __spirv_BuiltInXXXX.
@@ -1688,7 +1688,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
16881688
Initializer = Constant::getNullValue(Ty);
16891689
else if (BS == SPIRVStorageClassKind::StorageClassWorkgroup &&
16901690
LinkageTy != GlobalValue::ExternalLinkage)
1691-
Initializer = dyn_cast<Constant>(UndefValue::get(Ty));
1691+
Initializer = dyn_cast<Constant>(PoisonValue::get(Ty));
16921692
else if ((LinkageTy != GlobalValue::ExternalLinkage) &&
16931693
(BS == SPIRVStorageClassKind::StorageClassCrossWorkgroup))
16941694
Initializer = Constant::getNullValue(Ty);
@@ -2021,7 +2021,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
20212021
for (unsigned Idx = 0; Idx != N; ++Idx) {
20222022
Value *S = Builder.CreateExtractElement(Vec, Builder.getInt32(Idx));
20232023
Value *Lhs = Builder.CreateVectorSplat(M, S);
2024-
Value *Rhs = UndefValue::get(VTy);
2024+
Value *Rhs = PoisonValue::get(VTy);
20252025
for (unsigned Idx2 = 0; Idx2 != M; ++Idx2) {
20262026
Value *Vx = Builder.CreateExtractValue(Mat, Idx2);
20272027
Value *Vxi = Builder.CreateExtractElement(Vx, Builder.getInt32(Idx));
@@ -2046,7 +2046,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
20462046
Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
20472047
NewVec->takeName(Scalar);
20482048

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

2151-
Value *Res = UndefValue::get(ResultTy);
2151+
Value *Res = PoisonValue::get(ResultTy);
21522152

21532153
for (unsigned Idx = 0; Idx != C2; ++Idx) {
21542154
Value *U = Builder.CreateExtractValue(M2, Idx);
@@ -2181,7 +2181,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
21812181

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

21862186
SmallVector<Value *, 16> MCache;
21872187
MCache.reserve(ColNum);
@@ -2221,7 +2221,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
22212221

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

22262226
for (unsigned Idx2 = 0; Idx2 != ColNum; ++Idx2) {
22272227
Value *S =
@@ -2501,7 +2501,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
25012501
IntegerType *Int32Ty = IntegerType::get(*Context, 32);
25022502
for (auto I : VS->getComponents()) {
25032503
if (I == static_cast<SPIRVWord>(-1))
2504-
Components.push_back(UndefValue::get(Int32Ty));
2504+
Components.push_back(PoisonValue::get(Int32Ty));
25052505
else
25062506
Components.push_back(ConstantInt::get(Int32Ty, I));
25072507
}
@@ -2776,7 +2776,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
27762776
CarryInt = Builder.CreateZExt(Carry, Result->getType());
27772777
}
27782778
auto *ResultStruct =
2779-
Builder.CreateInsertValue(UndefValue::get(StructType::get(
2779+
Builder.CreateInsertValue(PoisonValue::get(StructType::get(
27802780
Result->getType(), CarryInt->getType())),
27812781
Result, 0);
27822782
ResultStruct = Builder.CreateInsertValue(ResultStruct, CarryInt, 1);
@@ -2808,8 +2808,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
28082808
PointerType *Int8PtrTyPrivate = PointerType::get(*Context, SPIRAS_Private);
28092809
IntegerType *Int32Ty = Type::getInt32Ty(*Context);
28102810

2811-
Value *UndefInt8Ptr = UndefValue::get(Int8PtrTyPrivate);
2812-
Value *UndefInt32 = UndefValue::get(Int32Ty);
2811+
Value *UndefInt8Ptr = PoisonValue::get(Int8PtrTyPrivate);
2812+
Value *UndefInt32 = PoisonValue::get(Int32Ty);
28132813

28142814
Constant *GS = Builder.CreateGlobalString(kOCLBuiltinName::FPGARegIntel);
28152815

@@ -4067,8 +4067,8 @@ void SPIRVToLLVM::transIntelFPGADecorations(SPIRVValue *BV, Value *V) {
40674067
Type *Int8PtrTyPrivate = PointerType::get(*Context, SPIRAS_Private);
40684068
IntegerType *Int32Ty = IntegerType::get(*Context, 32);
40694069

4070-
Value *UndefInt8Ptr = UndefValue::get(Int8PtrTyPrivate);
4071-
Value *UndefInt32 = UndefValue::get(Int32Ty);
4070+
Value *UndefInt8Ptr = PoisonValue::get(Int8PtrTyPrivate);
4071+
Value *UndefInt32 = PoisonValue::get(Int32Ty);
40724072

40734073
if (AL && BV->getType()->getPointerElementType()->isTypeStruct()) {
40744074
auto *ST = BV->getType()->getPointerElementType();
@@ -4205,8 +4205,8 @@ void SPIRVToLLVM::transIntelFPGADecorations(SPIRVValue *BV, Value *V) {
42054205

42064206
llvm::Constant *Fields[5] = {
42074207
C, ConstantExpr::getBitCast(GS, Int8PtrTyPrivate),
4208-
UndefValue::get(Int8PtrTyPrivate), UndefValue::get(Int32Ty),
4209-
UndefValue::get(Int8PtrTyPrivate)};
4208+
PoisonValue::get(Int8PtrTyPrivate), PoisonValue::get(Int32Ty),
4209+
PoisonValue::get(Int8PtrTyPrivate)};
42104210

42114211
GlobalAnnotations.push_back(ConstantStruct::getAnon(Fields));
42124212
}
@@ -4266,8 +4266,8 @@ void SPIRVToLLVM::transUserSemantic(SPIRV::SPIRVFunction *Fun) {
42664266

42674267
llvm::Constant *Fields[5] = {
42684268
C, ConstantExpr::getBitCast(GS, Int8PtrTyPrivate),
4269-
UndefValue::get(Int8PtrTyPrivate), UndefValue::get(Int32Ty),
4270-
UndefValue::get(Int8PtrTyPrivate)};
4269+
PoisonValue::get(Int8PtrTyPrivate), PoisonValue::get(Int32Ty),
4270+
PoisonValue::get(Int8PtrTyPrivate)};
42714271
GlobalAnnotations.push_back(ConstantStruct::getAnon(Fields));
42724272
}
42734273
}
@@ -4624,7 +4624,7 @@ bool SPIRVToLLVM::transMetadata() {
46244624
std::vector<Metadata *> MetadataVec;
46254625
Type *VecHintTy = decodeVecTypeHint(*Context, EM->getLiterals()[0]);
46264626
assert(VecHintTy);
4627-
MetadataVec.push_back(ValueAsMetadata::get(UndefValue::get(VecHintTy)));
4627+
MetadataVec.push_back(ValueAsMetadata::get(PoisonValue::get(VecHintTy)));
46284628
MetadataVec.push_back(ConstantAsMetadata::get(
46294629
ConstantInt::get(Type::getInt32Ty(*Context), 1)));
46304630
F->setMetadata(kSPIR2MD::VecTyHint, MDNode::get(*Context, MetadataVec));

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());
@@ -749,7 +749,7 @@ bool SPIRVRegularizeLLVMBase::regularize() {
749749
IRBuilder<> Builder(Cmpxchg);
750750
auto *Cmp = Builder.CreateICmpEQ(Res, Comparator, "cmpxchg.success");
751751
auto *V1 = Builder.CreateInsertValue(
752-
UndefValue::get(Cmpxchg->getType()), Res, 0);
752+
PoisonValue::get(Cmpxchg->getType()), Res, 0);
753753
auto *V2 = Builder.CreateInsertValue(V1, Cmp, 1, Cmpxchg->getName());
754754
Cmpxchg->replaceAllUsesWith(V2);
755755
ToErase.push_back(Cmpxchg);

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
}

lib/SPIRV/SPIRVUtil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ bool isSPIRVBuiltinVariable(GlobalVariable *GV,
19611961
// %d = extractelement <3 x i64> %b, i32 idx
19621962
// With:
19631963
// %0 = call spir_func i64 @_Z13get_global_idj(i32 0) #1
1964-
// %1 = insertelement <3 x i64> undef, i64 %0, i32 0
1964+
// %1 = insertelement <3 x i64> poison, i64 %0, i32 0
19651965
// %2 = call spir_func i64 @_Z13get_global_idj(i32 1) #1
19661966
// %3 = insertelement <3 x i64> %1, i64 %2, i32 1
19671967
// %4 = call spir_func i64 @_Z13get_global_idj(i32 2) #1
@@ -1976,7 +1976,7 @@ bool isSPIRVBuiltinVariable(GlobalVariable *GV,
19761976
// %2 = load i64, i64 addrspace(4)* %1, align 32
19771977
// With:
19781978
// %0 = call spir_func i64 @_Z13get_global_idj(i32 0) #1
1979-
// %1 = insertelement <3 x i64> undef, i64 %0, i32 0
1979+
// %1 = insertelement <3 x i64> poison, i64 %0, i32 0
19801980
// %2 = call spir_func i64 @_Z13get_global_idj(i32 1) #1
19811981
// %3 = insertelement <3 x i64> %1, i64 %2, i32 1
19821982
// %4 = call spir_func i64 @_Z13get_global_idj(i32 2) #1
@@ -2032,7 +2032,7 @@ static void replaceUsesOfBuiltinVar(Value *V, const APInt &AccumulatedOffset,
20322032
if (!Index.isZero() || DL.getTypeSizeInBits(VecTy) !=
20332033
DL.getTypeSizeInBits(Load->getType()))
20342034
llvm_unreachable("Illegal use of a SPIR-V builtin variable");
2035-
Replacement = UndefValue::get(VecTy);
2035+
Replacement = PoisonValue::get(VecTy);
20362036
for (unsigned I = 0; I < VecTy->getNumElements(); I++) {
20372037
Replacement = Builder.CreateInsertElement(
20382038
Replacement,

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

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

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

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)