Skip to content

Commit

Permalink
Use poison instead of undef values wherever possible (#2960)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vmaksimo authored Jan 20, 2025
1 parent f5e27fe commit cec12d6
Show file tree
Hide file tree
Showing 38 changed files with 132 additions and 128 deletions.
2 changes: 1 addition & 1 deletion docs/SPIRVRepresentationInLLVM.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ scalar component is mapped to a function call with index argument, i.e.:
; However SPIRV-LLVM translator will transform it to the following pattern:
%1 = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 0)
%2 = insertelement <3 x i64> undef, i64 %1, i32 0
%2 = insertelement <3 x i64> poison, i64 %1, i32 0
%3 = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 1)
%4 = insertelement <3 x i64> %2, i64 %3, i32 1
%5 = call spir_func i64 @_Z33__spirv_BuiltInGlobalInvocationIdi(i32 2)
Expand Down
6 changes: 3 additions & 3 deletions lib/SPIRV/LLVMSaddWithOverflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ if.then: ; preds = %entry
if.end21: ; preds = %if.then, %entry
%overflow = phi i1 [ 0, %entry ], [ %or.cond40, %if.then ]
%add24 = add i16 %b, %a
%agg = insertvalue {i16, i1} undef, i16 %add24, 0
%agg = insertvalue {i16, i1} poison, i16 %add24, 0
%res = insertvalue {i16, i1} %agg, i1 %overflow, 1
ret {i16, i1} %res
}
Expand Down Expand Up @@ -202,7 +202,7 @@ if.then12: ; preds = %land.lhs.true, %if.
if.end23: ; preds = %if.then12, %if.else, %land.lhs.true
%overflow = phi i1 [ 1, %land.lhs.true ], [ 0, %if.else ], [ %or.cond43, %if.then12 ]
%add24 = add nsw i32 %b, %a
%agg = insertvalue {i32, i1} undef, i32 %add24, 0
%agg = insertvalue {i32, i1} poison, i32 %add24, 0
%res = insertvalue {i32, i1} %agg, i1 %overflow, 1
ret {i32, i1} %res
}
Expand Down Expand Up @@ -242,7 +242,7 @@ if.then12: ; preds = %land.lhs.true, %if.
if.end23: ; preds = %if.then12, %if.else, %land.lhs.true
%overflow = phi i1 [ 1, %land.lhs.true ], [ 0, %if.else ], [ %or.cond42, %if.then12 ]
%add24 = add nsw i64 %b, %a
%agg = insertvalue {i64, i1} undef, i64 %add24, 0
%agg = insertvalue {i64, i1} poison, i64 %add24, 0
%res = insertvalue {i64, i1} %agg, i1 %overflow, 1
ret {i64, i1} %res
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SPIRV/LLVMToSPIRVDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void LLVMToSPIRVDbgTran::finalizeDebugValue(
DIExpression *Expr = DbgValue->getExpression();
if (!isNonSemanticDebugInfo()) {
if (DbgValue->getNumVariableLocationOps() > 1) {
Val = UndefValue::get(Val->getType());
Val = PoisonValue::get(Val->getType());
Expr = DIExpression::get(M->getContext(), {});
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/SPIRV/OCLToSPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ void OCLToSPIRVBase::visitCallGetImageSize(CallInst *CI,
} else if (Desc.Dim == Dim2D && Desc.Arrayed) {
Constant *Index[] = {getInt32(M, 0), getInt32(M, 1)};
Constant *Mask = ConstantVector::get(Index);
return new ShuffleVectorInst(NCI, UndefValue::get(NCI->getType()),
return new ShuffleVectorInst(NCI, PoisonValue::get(NCI->getType()),
Mask, NCI->getName(),
CI->getIterator());
}
Expand Down Expand Up @@ -1410,9 +1410,9 @@ void OCLToSPIRVBase::visitCallScalToVec(CallInst *CI, StringRef MangledName,
for (auto I : ScalarPos)
Mutator.mapArg(I, [&](Value *V) {
Instruction *Inst = InsertElementInst::Create(
UndefValue::get(VecTy), V, getInt32(M, 0), "", CI->getIterator());
PoisonValue::get(VecTy), V, getInt32(M, 0), "", CI->getIterator());
return new ShuffleVectorInst(
Inst, UndefValue::get(VecTy),
Inst, PoisonValue::get(VecTy),
ConstantVector::getSplat(VecElemCount, getInt32(M, 0)), "",
CI->getIterator());
});
Expand Down
4 changes: 2 additions & 2 deletions lib/SPIRV/SPIRVLowerBitCastToNonStandardType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static Value *removeBitCasts(Value *OldValue, Type *NewTy, NFIRBuilder &Builder,
// If there's only one use, don't create a bitcast for any uses, since it
// will be immediately replaced anyways.
if (OldValue->hasOneUse()) {
OldValue->replaceAllUsesWith(UndefValue::get(OldValue->getType()));
OldValue->replaceAllUsesWith(PoisonValue::get(OldValue->getType()));
} else {
OldValue->replaceAllUsesWith(
Builder.CreateBitCast(NewValue, OldValue->getType()));
Expand Down Expand Up @@ -95,7 +95,7 @@ static Value *removeBitCasts(Value *OldValue, Type *NewTy, NFIRBuilder &Builder,
if (auto *BC = dyn_cast<BitCastInst>(OldValue)) {
if (BC->getSrcTy() == NewTy) {
if (BC->hasOneUse()) {
BC->replaceAllUsesWith(UndefValue::get(BC->getType()));
BC->replaceAllUsesWith(PoisonValue::get(BC->getType()));
InstsToErase.push_back(BC);
}
return BC->getOperand(0);
Expand Down
36 changes: 18 additions & 18 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
Constant *Initializer = nullptr;
if (IsVectorCompute) {
AddrSpace = VectorComputeUtil::getVCGlobalVarAddressSpace(BS);
Initializer = UndefValue::get(Ty);
Initializer = PoisonValue::get(Ty);
} else
AddrSpace = SPIRSPIRVAddrSpaceMap::rmap(BS);
// Force SPIRV BuiltIn variable's name to be __spirv_BuiltInXXXX.
Expand All @@ -1688,7 +1688,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
Initializer = Constant::getNullValue(Ty);
else if (BS == SPIRVStorageClassKind::StorageClassWorkgroup &&
LinkageTy != GlobalValue::ExternalLinkage)
Initializer = dyn_cast<Constant>(UndefValue::get(Ty));
Initializer = dyn_cast<Constant>(PoisonValue::get(Ty));
else if ((LinkageTy != GlobalValue::ExternalLinkage) &&
(BS == SPIRVStorageClassKind::StorageClassCrossWorkgroup))
Initializer = Constant::getNullValue(Ty);
Expand Down Expand Up @@ -2021,7 +2021,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
for (unsigned Idx = 0; Idx != N; ++Idx) {
Value *S = Builder.CreateExtractElement(Vec, Builder.getInt32(Idx));
Value *Lhs = Builder.CreateVectorSplat(M, S);
Value *Rhs = UndefValue::get(VTy);
Value *Rhs = PoisonValue::get(VTy);
for (unsigned Idx2 = 0; Idx2 != M; ++Idx2) {
Value *Vx = Builder.CreateExtractValue(Mat, Idx2);
Value *Vxi = Builder.CreateExtractElement(Vx, Builder.getInt32(Idx));
Expand All @@ -2046,7 +2046,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
NewVec->takeName(Scalar);

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

Value *Res = UndefValue::get(ResultTy);
Value *Res = PoisonValue::get(ResultTy);

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

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

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

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

for (unsigned Idx2 = 0; Idx2 != ColNum; ++Idx2) {
Value *S =
Expand Down Expand Up @@ -2501,7 +2501,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
IntegerType *Int32Ty = IntegerType::get(*Context, 32);
for (auto I : VS->getComponents()) {
if (I == static_cast<SPIRVWord>(-1))
Components.push_back(UndefValue::get(Int32Ty));
Components.push_back(PoisonValue::get(Int32Ty));
else
Components.push_back(ConstantInt::get(Int32Ty, I));
}
Expand Down Expand Up @@ -2776,7 +2776,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
CarryInt = Builder.CreateZExt(Carry, Result->getType());
}
auto *ResultStruct =
Builder.CreateInsertValue(UndefValue::get(StructType::get(
Builder.CreateInsertValue(PoisonValue::get(StructType::get(
Result->getType(), CarryInt->getType())),
Result, 0);
ResultStruct = Builder.CreateInsertValue(ResultStruct, CarryInt, 1);
Expand Down Expand Up @@ -2808,8 +2808,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
PointerType *Int8PtrTyPrivate = PointerType::get(*Context, SPIRAS_Private);
IntegerType *Int32Ty = Type::getInt32Ty(*Context);

Value *UndefInt8Ptr = UndefValue::get(Int8PtrTyPrivate);
Value *UndefInt32 = UndefValue::get(Int32Ty);
Value *UndefInt8Ptr = PoisonValue::get(Int8PtrTyPrivate);
Value *UndefInt32 = PoisonValue::get(Int32Ty);

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

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

Value *UndefInt8Ptr = UndefValue::get(Int8PtrTyPrivate);
Value *UndefInt32 = UndefValue::get(Int32Ty);
Value *UndefInt8Ptr = PoisonValue::get(Int8PtrTyPrivate);
Value *UndefInt32 = PoisonValue::get(Int32Ty);

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

llvm::Constant *Fields[5] = {
C, ConstantExpr::getBitCast(GS, Int8PtrTyPrivate),
UndefValue::get(Int8PtrTyPrivate), UndefValue::get(Int32Ty),
UndefValue::get(Int8PtrTyPrivate)};
PoisonValue::get(Int8PtrTyPrivate), PoisonValue::get(Int32Ty),
PoisonValue::get(Int8PtrTyPrivate)};

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

llvm::Constant *Fields[5] = {
C, ConstantExpr::getBitCast(GS, Int8PtrTyPrivate),
UndefValue::get(Int8PtrTyPrivate), UndefValue::get(Int32Ty),
UndefValue::get(Int8PtrTyPrivate)};
PoisonValue::get(Int8PtrTyPrivate), PoisonValue::get(Int32Ty),
PoisonValue::get(Int8PtrTyPrivate)};
GlobalAnnotations.push_back(ConstantStruct::getAnon(Fields));
}
}
Expand Down Expand Up @@ -4624,7 +4624,7 @@ bool SPIRVToLLVM::transMetadata() {
std::vector<Metadata *> MetadataVec;
Type *VecHintTy = decodeVecTypeHint(*Context, EM->getLiterals()[0]);
assert(VecHintTy);
MetadataVec.push_back(ValueAsMetadata::get(UndefValue::get(VecHintTy)));
MetadataVec.push_back(ValueAsMetadata::get(PoisonValue::get(VecHintTy)));
MetadataVec.push_back(ConstantAsMetadata::get(
ConstantInt::get(Type::getInt32Ty(*Context), 1)));
F->setMetadata(kSPIR2MD::VecTyHint, MDNode::get(*Context, MetadataVec));
Expand Down
6 changes: 3 additions & 3 deletions lib/SPIRV/SPIRVRegularizeLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void SPIRVRegularizeLLVMBase::buildUMulWithOverflowFunc(Function *UMulFunc) {
// umul.with.overflow intrinsic return a structure, where the first element
// is the multiplication result, and the second is an overflow bit.
auto *StructTy = UMulFunc->getReturnType();
auto *Agg = Builder.CreateInsertValue(UndefValue::get(StructTy), Mul, {0});
auto *Agg = Builder.CreateInsertValue(PoisonValue::get(StructTy), Mul, {0});
auto *Res = Builder.CreateInsertValue(Agg, Overflow, {1});
Builder.CreateRet(Res);
}
Expand Down Expand Up @@ -487,7 +487,7 @@ void regularizeWithOverflowInstrinsics(StringRef MangledName, CallInst *Call,
Value *V2 = Builder.CreateICmpNE(V1, ConstZero);
Type *StructI32I1Ty =
StructType::create(Call->getContext(), {RetTy, V2->getType()});
Value *Undef = UndefValue::get(StructI32I1Ty);
Value *Undef = PoisonValue::get(StructI32I1Ty);
Value *V3 = Builder.CreateInsertValue(Undef, V0, {0});
Value *V4 = Builder.CreateInsertValue(V3, V2, {1});
SmallVector<User *> Users(Call->users());
Expand Down Expand Up @@ -749,7 +749,7 @@ bool SPIRVRegularizeLLVMBase::regularize() {
IRBuilder<> Builder(Cmpxchg);
auto *Cmp = Builder.CreateICmpEQ(Res, Comparator, "cmpxchg.success");
auto *V1 = Builder.CreateInsertValue(
UndefValue::get(Cmpxchg->getType()), Res, 0);
PoisonValue::get(Cmpxchg->getType()), Res, 0);
auto *V2 = Builder.CreateInsertValue(V1, Cmp, 1, Cmpxchg->getName());
Cmpxchg->replaceAllUsesWith(V2);
ToErase.push_back(Cmpxchg);
Expand Down
8 changes: 4 additions & 4 deletions lib/SPIRV/SPIRVToOCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void SPIRVToOCLBase::visitCallSPIRVImageQuerySize(CallInst *CI) {
assert(ImgQuerySizeRetEls == 2 &&
"OpImageQuerySize[Lod] must return <2 x iN> vector type");
GetImageSize = InsertElementInst::Create(
UndefValue::get(VecTy), GetImageSize, ConstantInt::get(Int32Ty, 0),
PoisonValue::get(VecTy), GetImageSize, ConstantInt::get(Int32Ty, 0),
CI->getName(), CI->getIterator());
} else {
// get_image_dim and OpImageQuerySize returns different vector
Expand All @@ -337,7 +337,7 @@ void SPIRVToOCLBase::visitCallSPIRVImageQuerySize(CallInst *CI) {
Constant *Mask = ConstantVector::get(MaskEls);

GetImageSize = new ShuffleVectorInst(
GetImageSize, UndefValue::get(GetImageSize->getType()), Mask,
GetImageSize, PoisonValue::get(GetImageSize->getType()), Mask,
CI->getName(), CI->getIterator());
}
}
Expand Down Expand Up @@ -779,7 +779,7 @@ void SPIRVToOCLBase::visitCallSPIRVImageSampleExplicitLodBuiltIn(CallInst *CI,

if (CallSampledImg->hasOneUse()) {
CallSampledImg->replaceAllUsesWith(
UndefValue::get(CallSampledImg->getType()));
PoisonValue::get(CallSampledImg->getType()));
CallSampledImg->dropAllReferences();
CallSampledImg->eraseFromParent();
}
Expand Down Expand Up @@ -871,7 +871,7 @@ void SPIRVToOCLBase::visitCallSPIRVAvcINTELEvaluateBuiltIn(CallInst *CI,

auto EraseVmeImageCall = [](CallInst *CI) {
if (CI->hasOneUse()) {
CI->replaceAllUsesWith(UndefValue::get(CI->getType()));
CI->replaceAllUsesWith(PoisonValue::get(CI->getType()));
CI->dropAllReferences();
CI->eraseFromParent();
}
Expand Down
6 changes: 3 additions & 3 deletions lib/SPIRV/SPIRVUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ bool isSPIRVBuiltinVariable(GlobalVariable *GV,
// %d = extractelement <3 x i64> %b, i32 idx
// With:
// %0 = call spir_func i64 @_Z13get_global_idj(i32 0) #1
// %1 = insertelement <3 x i64> undef, i64 %0, i32 0
// %1 = insertelement <3 x i64> poison, i64 %0, i32 0
// %2 = call spir_func i64 @_Z13get_global_idj(i32 1) #1
// %3 = insertelement <3 x i64> %1, i64 %2, i32 1
// %4 = call spir_func i64 @_Z13get_global_idj(i32 2) #1
Expand All @@ -1976,7 +1976,7 @@ bool isSPIRVBuiltinVariable(GlobalVariable *GV,
// %2 = load i64, i64 addrspace(4)* %1, align 32
// With:
// %0 = call spir_func i64 @_Z13get_global_idj(i32 0) #1
// %1 = insertelement <3 x i64> undef, i64 %0, i32 0
// %1 = insertelement <3 x i64> poison, i64 %0, i32 0
// %2 = call spir_func i64 @_Z13get_global_idj(i32 1) #1
// %3 = insertelement <3 x i64> %1, i64 %2, i32 1
// %4 = call spir_func i64 @_Z13get_global_idj(i32 2) #1
Expand Down Expand Up @@ -2032,7 +2032,7 @@ static void replaceUsesOfBuiltinVar(Value *V, const APInt &AccumulatedOffset,
if (!Index.isZero() || DL.getTypeSizeInBits(VecTy) !=
DL.getTypeSizeInBits(Load->getType()))
llvm_unreachable("Illegal use of a SPIR-V builtin variable");
Replacement = UndefValue::get(VecTy);
Replacement = PoisonValue::get(VecTy);
for (unsigned I = 0; I < VecTy->getNumElements(); I++) {
Replacement = Builder.CreateInsertElement(
Replacement,
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/LocalAddressSpace.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
; CHECK-SPIRV: Variable {{[0-9]+}} [[foo_a:[0-9]+]]
; CHECK-SPIRV: DebugGlobalVariable {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} [[foo_a]]

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

Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/builtin-get-global-id.ll
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ entry:
%gid = alloca i64, align 8
%call = call spir_func i64 @_Z13get_global_idj(i32 0) #2, !dbg !10
; CHECK: [[I0:%[0-9]]] = call spir_func i64 @_Z13get_global_idj(i32 0) #1, !dbg [[DBG:![0-9]+]]
; CHECK-NEXT: [[I1:%[0-9]]] = insertelement <3 x i64> undef, i64 [[I0]], i32 0, !dbg [[DBG]]
; CHECK-NEXT: [[I1:%[0-9]]] = insertelement <3 x i64> poison, i64 [[I0]], i32 0, !dbg [[DBG]]
; CHECK-NEXT: [[I2:%[0-9]]] = call spir_func i64 @_Z13get_global_idj(i32 1) #1, !dbg [[DBG]]
; CHECK-NEXT: [[I3:%[0-9]]] = insertelement <3 x i64> [[I1]], i64 [[I2]], i32 1, !dbg [[DBG]]
; CHECK-NEXT: [[I4:%[0-9]]] = call spir_func i64 @_Z13get_global_idj(i32 2) #1, !dbg [[DBG]]
Expand Down
2 changes: 1 addition & 1 deletion test/OpDecorateString_UserSemantic.spvasm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
; the SPIR-V LLVM Translator and not rejected by spirv-val.
OpDecorateString %temp UserSemantic "foo"
; CHECK: [[STR:@[0-9_.]+]] = {{.*}}foo
; CHECK: call void @llvm.var.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr undef, i32 undef, ptr undef)
; CHECK: call void @llvm.var.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr poison, i32 poison, ptr poison)
%uint = OpTypeInt 32 0
%void = OpTypeVoid
%kernel_sig = OpTypeFunction %void %uint
Expand Down
2 changes: 1 addition & 1 deletion test/OpMemberDecorateString_UserSemantic.spvasm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
; CHECK: [[STR:@[0-9_.]+]] = {{.*}}foo
; Note: this is checking for an annotation on an instantiation of the structure,
; which is different than an annotation on the structure type.
; CHECK: call ptr @llvm.ptr.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr undef, i32 undef, ptr undef)
; CHECK: call ptr @llvm.ptr.annotation.p0.p0(ptr %{{.*}}, ptr [[STR]], ptr poison, i32 poison, ptr poison)
%uint = OpTypeInt 32 0
%uint_0 = OpConstant %uint 0
%void = OpTypeVoid
Expand Down
Loading

0 comments on commit cec12d6

Please sign in to comment.