Skip to content

Commit

Permalink
replace more undefs with poison
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksimo committed Jan 14, 2025
1 parent cf1d5d9 commit e785974
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion lib/SPIRV/SPIRVRegularizeLLVM.cpp
Original file line number Diff line number Diff line change
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

0 comments on commit e785974

Please sign in to comment.